[−][src]Crate proj
proj
provides bindings to the PROJ v6.3.x API
Two coordinate operations are currently provided: projection (and inverse projection) and conversion. Projection is intended for transformations between geodetic and projected coordinates, and vice versa (inverse projection), while conversion is intended for transformations between projected coordinate systems. The PROJ documentation explains the distinction between these operations.
Anything that can be converted into a geo-types
Point
via the Into
trait can be used as input for the projection and conversion functions, and methods
for conversion and projection
of slices of Point
s are available.
Example
use assert_approx_eq::assert_approx_eq; extern crate proj; use proj::Proj; extern crate geo_types; use geo_types::Point; let from = "EPSG:2230"; let to = "EPSG:26946"; let nad_ft_to_m = Proj::new_known_crs(&from, &to, None).unwrap(); let result = nad_ft_to_m .convert(Point::new(4760096.421921f64, 3744293.729449f64)) .unwrap(); assert_approx_eq!(result.x(), 1450880.29f64, 1.0e-2); assert_approx_eq!(result.y(), 1141263.01f64, 1.0e-2);
Structs
Area | The bounding box of an area of use |
Proj | A |