Crates.io | rosewood |
lib.rs | rosewood |
version | 0.3.3 |
source | src |
created_at | 2021-08-29 19:59:24.757619 |
updated_at | 2024-11-21 14:26:14.997517 |
description | A file-based RTree for geospatial data |
homepage | |
repository | https://github.com/DougLau/loam/rosewood |
max_upload_size | |
id | 443883 |
size | 50,052 |
A file-based RTree for geospatial data, such as Point
s, Linestring
s and
Polygon
s.
use rosewood::{BulkWriter, gis::Points};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut w = BulkWriter::new("points.loam")?;
let mut a = Points::new("point A".to_string());
a.push((5.0, 1.0));
let mut b = Points::new("point B".to_string());
b.push((3.0, 7.3));
w.push(&a)?;
w.push(&b)?;
w.finish()?;
Ok(())
}
GisData
can have associated data, which must implement the Serialize
/ Deserialize
traits from serde. In the example above, this is String
.