geopackage 0.1.0

Read and write OGC GeoPackage (.gpkg) files: pure-Rust container handling over bundled SQLite, with spec-correct spatial indexing
Documentation

Read and write OGC GeoPackage files.

Status: M1 read path. The container is created and opened with pragma and schema validation ([GeoPackage::create], [GeoPackage::open], [GeoPackage::open_read_only], [GeoPackage::from_connection]), and the required RTree SQL functions are registered on every connection. On top of gpkg_contents, gpkg_spatial_ref_sys ([Srs]) and per-table schema introspection ([TableSchema]), this crate exposes a read path:

  • [GeoPackage::layers] enumerates feature layers; [GeoPackage::layer] and [GeoPackage::attributes] return typed [Layer] handles.
  • [Layer::features] iterates a layer as owned [Feature]s, with by-name and by-index value access and lazy geometry parsing.
  • [Layer::features_in] runs a bounding-box query, using the RTree spatial index when one is present and a full scan otherwise, with provably identical results.
  • [Layer::select] appends a caller-supplied WHERE clause (raw SQL, per design decision D9: SQL is the query engine).
  • [Layer::create_spatial_index], [Layer::drop_spatial_index], and [Layer::repair_spatial_index] manage the RTree spatial index (the GeoPackage 1.4 trigger set, design decision D7). Building a large index — [Layer::create_spatial_index_with], or [Layer::write_all] into a fresh indexed layer — uses the D8 bulk shadow-table build ([BulkIndexOptions]).
  • [GeoPackage::open_lenient] tolerates legacy and lightly malformed files, collecting [OpenWarning]s instead of failing.

The GeoArrow bulk plane arrives in a later milestone — see the repository roadmap.

# fn main() -> Result<(), geopackage::Error> {
let gpkg = geopackage::GeoPackage::create("example.gpkg")?;
assert!(gpkg.contents()?.is_empty());
# Ok(()) }