This crate implements geographic transformations between different coordinate systems defined by the European Petroleum Survey Group.
Think of it as a very lightweight PROJ. Conversions between projected and geographic coordinate systems that are assigned an EPSG code are implemented according to the Guidance Notes, with all "dynamically uniform" local variables being calculated at compile time. The conversions are then stored in a static PHF Map for quick access at runtime. Code generation and actual implementation of specific operations are implemented in the miniproj-epsg-registry
and miniproj-ops
crates respectively.
Currently, only the transverse mercator and lambert azimuthal equal area coordinate operations are completely implemented.
It was written at the GEOMAR Helmholtz Centre for Ocean Research as part of the Digital Earth Project.
As many of the other components created in this project, it is licensed under EUPL v1.2. This license does not apply to the projections themselves. The database files are extracts from the EPSG Geodetic Parameter Registry and distributed under their own Terms of Use.
```rust // Create a boxed converter between WGS84 Lat/Lon and WGS84 UTM zone 32N use miniproj::{getcoordtransform, CoordTransform}; let converter = getcoordtransform(32632).expect("Coordinate conversion not implemented");
// Coordinates of the office where this converter was written in UTM: let (x,y) = (576935.86f64, 6020593.46f64);
// To get the latitude and longitude, use the CoordTransform::todeg method. let (lon, lat) = converter.todeg(x,y);
assert!((lon - 10.183034) < 0.000001); assert!((lat - 54.327389) < 0.000001); ```