Crates.io | flatgeobuf |
lib.rs | flatgeobuf |
version | |
source | src |
created_at | 2020-03-20 18:48:42.688991 |
updated_at | 2024-12-09 18:38:33.716691 |
description | FlatGeobuf for Rust |
homepage | https://flatgeobuf.org/ |
repository | https://github.com/flatgeobuf/flatgeobuf/tree/master/src/rust |
max_upload_size | |
id | 220764 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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.
use flatgeobuf::*;
fn main() {
let mut filein = BufReader::new(File::open("countries.fgb")?);
let mut fgb = FgbReader::open(&mut filein)?.select_all()?;
while let Some(feature) = fgb.next()? {
println!("{}", feature.property::<String>("name").unwrap());
println!("{}", feature.to_json()?);
}
}
With async HTTP client:
use flatgeobuf::*;
async fn process() {
let mut fgb = HttpFgbReader::open("https://flatgeobuf.org/test/data/countries.fgb")
.await?
.select_bbox(8.8, 47.2, 9.5, 55.3)
.await?;
while let Some(feature) = fgb.next().await? {
let props = feature.properties()?;
println!("{}", props["name"]);
println!("{}", feature.to_wkt()?);
}
}
See documentation and tests for more examples.
cargo test
cargo criterion
cargo install cargo-fuzz
cargo +nightly fuzz run read