pub struct Projection { /* private fields */ }Expand description
A configured map projection ready for forward and inverse transformations.
Implementations§
Source§impl Projection
impl Projection
Sourcepub fn new(params: ProjectionParams) -> Result<Self>
pub fn new(params: ProjectionParams) -> Result<Self>
Build a Projection from the given parameters.
Sourcepub fn forward(&self, lon_deg: f64, lat_deg: f64) -> Result<(f64, f64)>
pub fn forward(&self, lon_deg: f64, lat_deg: f64) -> Result<(f64, f64)>
Forward projection: geographic (lon, lat) degrees → projected (x, y) meters.
Sourcepub fn inverse(&self, x: f64, y: f64) -> Result<(f64, f64)>
pub fn inverse(&self, x: f64, y: f64) -> Result<(f64, f64)>
Inverse projection: projected (x, y) meters → geographic (lon, lat) degrees.
Sourcepub fn params(&self) -> &ProjectionParams
pub fn params(&self) -> &ProjectionParams
Return a reference to the projection parameters.
Trait Implementations§
Source§impl Clone for Projection
impl Clone for Projection
Source§impl CoordTransform for Projection
impl CoordTransform for Projection
Auto Trait Implementations§
impl Freeze for Projection
impl !RefUnwindSafe for Projection
impl Send for Projection
impl Sync for Projection
impl Unpin for Projection
impl UnsafeUnpin for Projection
impl !UnwindSafe for Projection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more