geonative_core/lib.rs
1//! # geonative-core
2//!
3//! Core data model for [`geonative`](https://geonative.zebflow.com) — a
4//! lightweight, pure-Rust geospatial library built from scratch.
5//!
6//! This crate defines the **interoperable intermediate representation** that
7//! every format driver (`geonative-filegdb`, `geonative-shapefile`,
8//! `geonative-geojson`, `geonative-geoparquet`, …) reads into or writes from.
9//! The model is Simple-Features-shaped so WKB encoding, GeoJSON, Shapefile,
10//! and GeoParquet writers all become near-trivial walks over the tree.
11//!
12//! ## What's in here
13//!
14//! - [`Geometry`] — the geometry tree (Point/Multi*/Polygon/Collection)
15//! - [`Coord`] — a single coordinate, with optional `z` and `m`
16//! - [`Value`] / [`ValueType`] — attribute values and their type tags
17//! - [`Feature`] — `fid` + optional geometry + indexed attribute vector
18//! - [`Schema`] / [`FieldDef`] / [`GeomField`] — layer schema description
19//! - [`Crs`] — coordinate reference system (EPSG / WKT / PROJJSON)
20//! - [`Error`] — common error type
21//!
22//! ## Cargo features
23//!
24//! - `geo-types` *(off by default)* — `From`/`Into` conversions between this
25//! crate's [`Geometry`] and [`geo_types::Geometry`], plus `Coord`. Z/M is
26//! silently dropped because `geo-types` is 2D.
27
28#![forbid(unsafe_code)]
29#![warn(missing_debug_implementations)]
30
31pub mod crs;
32pub mod error;
33pub mod feature;
34pub mod geometry;
35pub mod schema;
36pub mod value;
37pub mod wkb;
38
39#[cfg(feature = "geo-types")]
40pub mod geo_types_interop;
41
42pub use crs::Crs;
43pub use error::{Error, Result};
44pub use feature::Feature;
45pub use geometry::{Coord, Geometry, GeometryType, LineString, Polygon};
46pub use schema::{FieldDef, GeomField, Schema};
47pub use value::{Value, ValueType};
48pub use wkb::bbox_from_bytes;
49
50/// Crate version, for diagnostic use.
51pub const VERSION: &str = env!("CARGO_PKG_VERSION");