Skip to main content

Equirectangular

Struct Equirectangular 

Source
pub struct Equirectangular;
Expand description

Equirectangular projection: trivial linear mapping of lon/lat to meters.

Uses the WGS-84 semi-major axis (R = 6 378 137 m) as the scaling factor so that output units are meters at the equator. This is a zero-size type – construction is free.

Trait Implementations§

Source§

impl Projection for Equirectangular

Source§

fn project(&self, geo: &GeoCoord) -> WorldCoord

Forward projection: geographic degrees to world meters.

x = R * lon_rad, y = R * lat_rad, z = alt (passthrough).

Source§

fn unproject(&self, world: &WorldCoord) -> GeoCoord

Inverse projection: world meters back to geographic degrees.

lat = degrees(y / R), lon = degrees(x / R), alt = z.

Source§

fn scale_factor(&self, geo: &GeoCoord) -> f64

Scale factor for Equirectangular: sec(lat) = 1 / cos(lat).

The projection maps longitude linearly, so X distances are stretched relative to true distances by sec(lat), the same as the meridian convergence factor. Along Y the scale is 1.0, so this returns the maximum linear distortion at the point.

Source§

fn projection_bounds(&self) -> GeoBounds

The geographic bounding box of valid input for this projection. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.