Skip to main content

Crate geonative_proj

Crate geonative_proj 

Source
Expand description

§geonative-proj

Pure-Rust projection engine for the geonative geospatial library. No PROJ, no C dep — every projection is implemented from scratch.

§What v0.1 covers

  • EPSG:4326 ↔ EPSG:3857 — spherical Web Mercator
  • WGS84/UTM zones 1–60 N+S (EPSG:32601–32760)
  • GDA2020/MGA zones 46–59 (EPSG:7846–7859) — Transverse Mercator on GRS80 ellipsoid, southern-hemisphere false-northing
  • EPSG:7844 ≡ EPSG:4326 for v0.1 (treated as identity; ~1.5 m visualisation-grade caveat — full Helmert 7-param transform is v0.2)

Two projected CRSes (e.g. MGA-55 → WGS84/UTM-54) automatically pipe through 4326.

§Accuracy

  • Web Mercator is exact per the spherical-Mercator definition.
  • TM (UTM/MGA) uses Krüger n-series, 6th order — sub-millimetre accuracy out to ±4° from the central meridian (well past the standard ±3° zone half-width).

§Usage

use geonative_proj::Transformer;
use geonative_core::Coord;

let t = Transformer::from_epsg(7855, 4326)?;   // Vicmap MGA Zone 55 → WGS84
let mut c = Coord::xy(500000.0, 5800000.0);
t.transform(&mut c)?;
// c.x ≈ 147.0 (central meridian), c.y ≈ -37.95

§How it composes with the rest of the stack

geonative-convert’s pipeline picks up a Transformer from the --to-crs flag and applies transform_geometry to each feature mid-stream — one method call per feature, no allocation.

Re-exports§

pub use ellipsoid::Ellipsoid;
pub use ellipsoid::GRS80;
pub use ellipsoid::WGS84;
pub use error::ProjError;
pub use error::Result;
pub use transformer::Transformer;

Modules§

ellipsoid
Reference ellipsoid parameters.
epsg
EPSG code → projection parameters lookup.
error
Projection-engine error type.
spherical_mercator
EPSG:4326 ↔ EPSG:3857 — spherical Web Mercator.
tm
Ellipsoidal Transverse Mercator via the Krüger n-series (6th order).
transformer
The Transformer handle — constructed once, applied to many coords.

Constants§

VERSION