Rust implementation of FlatGeobuf.
FlatGeobuf is a performant binary encoding for geographic data based on flatbuffers that can hold a collection of Simple Features including circular interpolations as defined by SQL-MM Part 3.
```rust use flatgeobuf::*;
let mut file = BufReader::new(File::open("countries.fgb")?); let hreader = HeaderReader::read(&mut file)?; let header = hreader.header();
let mut freader = FeatureReader::selectbbox(&mut file, &header, 8.8, 47.2, 9.5, 55.3)?; while let Ok(feature) = freader.next(&mut file) { let props = feature.propertiesmap(&header); println!("{}", props["name"]); } ```
With async HTTP client: ```rust use flatgeobuf::*;
let mut client = BufferedHttpClient::new("https://pkg.sourcepole.ch/countries.fgb"); let hreader = HttpHeaderReader::read(&mut client).await.unwrap(); let header = hreader.header();
let mut freader = HttpFeatureReader::selectall(&header, hreader.headerlen()).await?; while let Ok(feature) = freader.next(&mut client).await { let props = feature.properties_map(&header); println!("{}", props["name"]); } ```
See documentation and tests for more examples.
cargo test
cargo bench