Expand description
Pure-Rust coordinate transformation library.
No C dependencies, no unsafe, WASM-compatible.
The primary type is Transform, which provides CRS-to-CRS coordinate
transformation using authority codes (e.g., "EPSG:4326").
§Example
use proj_core::Transform;
// Create a transform from WGS84 geographic to Web Mercator
let t = Transform::new("EPSG:4326", "EPSG:3857").unwrap();
// Transform NYC coordinates (lon, lat in degrees) → (x, y in meters)
let (x, y) = t.convert((-74.006, 40.7128)).unwrap();
assert!((x - (-8238310.0)).abs() < 100.0);
// Inverse: Web Mercator → WGS84
let inv = Transform::new("EPSG:3857", "EPSG:4326").unwrap();
let (lon, lat) = inv.convert((x, y)).unwrap();
assert!((lon - (-74.006)).abs() < 1e-6);Re-exports§
pub use coord::Bounds;pub use coord::Coord;pub use coord::Coord3D;pub use coord::Transformable;pub use coord::Transformable3D;pub use crs::CrsDef;pub use crs::GeographicCrsDef;pub use crs::ProjectedCrsDef;pub use crs::ProjectionMethod;pub use datum::Datum;pub use datum::HelmertParams;pub use ellipsoid::Ellipsoid;pub use error::Error;pub use error::Result;pub use registry::lookup_epsg;pub use transform::Transform;