27 releases (14 stable)

5.0.0 Aug 1, 2025
4.6.0 Feb 12, 2025
4.5.0 Dec 9, 2024
4.4.0 Sep 26, 2024
0.3.0 Mar 20, 2020

#18 in Geospatial

Download history 182/week @ 2025-07-21 377/week @ 2025-07-28 590/week @ 2025-08-04 348/week @ 2025-08-11 204/week @ 2025-08-18 221/week @ 2025-08-25 310/week @ 2025-09-01 719/week @ 2025-09-08 497/week @ 2025-09-15 453/week @ 2025-09-22 479/week @ 2025-09-29 273/week @ 2025-10-06 499/week @ 2025-10-13 275/week @ 2025-10-20 265/week @ 2025-10-27 206/week @ 2025-11-03

1,261 downloads per month
Used in 19 crates (16 directly)

BSD-2-Clause

270KB
5.5K SLoC

FlatGeobuf for Rust

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.

Usage

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.

Run tests and benchmarks

cargo test

cargo criterion

Run fuzzer

cargo install cargo-fuzz

cargo +nightly fuzz run read

Dependencies

~4–21MB
~281K SLoC