geometry-proj
Part of the boost_geometry workspace — a Rust port of Boost.Geometry. Most users should depend on the facade crate, which re-exports this one; depend on this crate directly only for a slimmer build.
Coordinate-reference-system reprojection for the geometry kernel.
Boost.Geometry defers projections to its unsupported
extensions/gis/projections/; this crate fills the gap with the
pure-Rust [proj4rs] engine (no C dependency). Build a [Crs] from
a proj4 string, an EPSG code, or a WKT definition, then
reproject a geometry from one CRS to another in
place.
use Cartesian;
use Point2D;
use ;
use Point as _;
let wgs84 = from_epsg.unwrap; // lon/lat, radians
let mercator = from_epsg.unwrap; // metres
let mut p = new;
reproject.unwrap;
assert!;
Units
proj4rs carries geographic coordinates in radians; convert with
[f64::to_radians] / [f64::to_degrees] at the boundary. See
reproject for detail.
Module layout:
- [
crs] — the [Crs] type and its constructors. reproject— the [ReprojectPoints] hook and thereprojectfunction.
License
BSL-1.0 — see LICENSE.