Skip to main content

Crate geonative_core

Crate geonative_core 

Source
Expand description

§geonative-core

The data model + WKB codec + object-safe Dataset/Layer traits that every other geonative crate builds on. Zero-dep (apart from thiserror) and the optional geo-types feature for ecosystem interop.

§What’s in it

Pick one of these as your starting point depending on what you’re doing:

ModuleWhat it gives you
geometryCoord, Geometry (Simple Features tree), LineString, Polygon, GeometryType
valueValue (attribute payload) + ValueType (schema discriminant)
schemaSchema + FieldDef + GeomField — table-of-contents for one layer
featureFeature — fid + geometry + attributes
crsCrs enum (Unknown / Epsg / Wkt / Projjson) + EPSG resolution
wkbOGC SF WKB encoder + decoder + alloc-free bbox walker
datasetObject-safe Dataset / Layer traits for format-polymorphic code
errorCrate-wide Error + Result
[geo_types_interop] (feature-gated)Conversions to/from the geo-types crate
[raster] (feature-gated)Raster IR — RasterTile, Band, PixelType, GeoTransform, RasterProfile, RasterLayer trait

§Why this crate exists

Every format crate (filegdb, shapefile, geoparquet, mvt) reads/writes its bytes into the same Feature / Geometry / Schema types defined here. That sharing is what makes the workspace a coherent library instead of seven independent format codecs.

§Stability

See STABILITY.md at the repo root. The growable IR enums (Geometry, GeometryType, Value, ValueType, Crs) are #[non_exhaustive] — adding variants in a SemVer-minor release does not count as a break.

§What’s in here

  • Geometry — the geometry tree (Point/Multi*/Polygon/Collection)
  • Coord — a single coordinate, with optional z and m
  • Value / ValueType — attribute values and their type tags
  • Featurefid + optional geometry + indexed attribute vector
  • Schema / FieldDef / GeomField — layer schema description
  • Crs — coordinate reference system (EPSG / WKT / PROJJSON)
  • Error — common error type

§Cargo features

  • geo-types (off by default)From/Into conversions between this crate’s Geometry and [geo_types::Geometry], plus Coord. Z/M is silently dropped because geo-types is 2D.
  • raster (off by default) — adds the [raster] module with the raster IR (RasterTile, Band, PixelType, GeoTransform, RasterProfile, RasterLayer trait). Required by geonative-geotiff and any raster format / processing crate. Vector-only consumers don’t need this feature.

Re-exports§

pub use crs::Crs;
pub use dataset::Dataset;
pub use dataset::Layer;
pub use dataset::SingleLayerDataset;
pub use error::Error;
pub use error::Result;
pub use feature::Feature;
pub use geometry::Coord;
pub use geometry::Geometry;
pub use geometry::GeometryType;
pub use geometry::LineString;
pub use geometry::Polygon;
pub use schema::FieldDef;
pub use schema::GeomField;
pub use schema::Schema;
pub use value::Value;
pub use value::ValueType;
pub use wkb::bbox_from_bytes;

Modules§

crs
Coordinate reference system. Carried through verbatim from the source so each writer can serialize it in its own preferred form.
dataset
Object-safe Dataset + Layer traits — the polymorphic surface that every concrete reader (geonative-filegdb, geonative-shapefile, future GPKG / GeoJSON / FlatGeoBuf) implements.
error
The crate-wide error type plus its Result alias.
feature
The “feature” — one row in a spatial dataset.
geometry
Simple-Features geometry tree with optional Z/M ordinates.
schema
Layer schema — the table-of-contents for one layer’s attributes + geometry + CRS.
value
Attribute values and their type tags.
wkb
OGC Simple Features Well-Known Binary (WKB) encoder + decoder for Geometry.

Constants§

VERSION
Crate version, for diagnostic use.