geonative_proj/lib.rs
1//! # geonative-proj
2//!
3//! Pure-Rust projection engine for the
4//! [`geonative`](https://geonative.zebflow.com) geospatial library. No PROJ,
5//! no C dep — every projection is implemented from scratch.
6//!
7//! ## What v0.1 covers
8//!
9//! - **EPSG:4326 ↔ EPSG:3857** — spherical Web Mercator
10//! - **WGS84/UTM zones 1–60 N+S** (EPSG:32601–32760)
11//! - **GDA2020/MGA zones 46–59** (EPSG:7846–7859) — Transverse Mercator on
12//! GRS80 ellipsoid, southern-hemisphere false-northing
13//! - **EPSG:7844 ≡ EPSG:4326** for v0.1 (treated as identity; ~1.5 m
14//! visualisation-grade caveat — full Helmert 7-param transform is v0.2)
15//!
16//! Two projected CRSes (e.g. MGA-55 → WGS84/UTM-54) automatically pipe
17//! through 4326.
18//!
19//! ## Accuracy
20//!
21//! - Web Mercator is **exact** per the spherical-Mercator definition.
22//! - TM (UTM/MGA) uses **Krüger n-series, 6th order** — sub-millimetre
23//! accuracy out to ±4° from the central meridian (well past the standard
24//! ±3° zone half-width).
25//!
26//! ## Usage
27//!
28//! ```
29//! use geonative_proj::Transformer;
30//! use geonative_core::Coord;
31//!
32//! let t = Transformer::from_epsg(7855, 4326)?; // Vicmap MGA Zone 55 → WGS84
33//! let mut c = Coord::xy(500000.0, 5800000.0);
34//! t.transform(&mut c)?;
35//! // c.x ≈ 147.0 (central meridian), c.y ≈ -37.95
36//! # Ok::<(), geonative_proj::ProjError>(())
37//! ```
38//!
39//! ## How it composes with the rest of the stack
40//!
41//! `geonative-convert`'s pipeline picks up a `Transformer` from the
42//! `--to-crs` flag and applies `transform_geometry` to each feature
43//! mid-stream — one method call per feature, no allocation.
44
45#![forbid(unsafe_code)]
46#![warn(missing_debug_implementations)]
47
48pub mod ellipsoid;
49pub mod epsg;
50pub mod error;
51pub mod spherical_mercator;
52pub mod tm;
53pub mod transformer;
54
55pub use ellipsoid::{Ellipsoid, GRS80, WGS84};
56pub use error::{ProjError, Result};
57pub use transformer::Transformer;
58
59pub const VERSION: &str = env!("CARGO_PKG_VERSION");