pub struct MercatorBaseProjection<const C: i64> { /* private fields */ }Expand description
§Mercator Projection
The Mercator projection is a cylindrical map projection originating from the 16th century. It is widely recognized as the first regularly used map projection. It is a conformal projection where the equator projects to a straight line at constant scale. A rhumb line, or course of constant heading, projects to a straight line, making it suitable for navigational purposes.
Classification: Conformal cylindrical
Available forms: Forward and Inverse, spherical and ellipsoidal
Defined area: Global, but best used near the equator
Alias: merc
Domain: 2D
Input type: Geodetic coordinates
Output type: Projected coordinates
§Projection String
+proj=merc§Usage
The Mercator projection is often used for equatorial regions and navigational charts. It is not suitable for world maps due to significant area distortions. For example, Greenland appears larger than South America in the projection, despite Greenland’s actual area being approximately one-eighth of South America’s.
Examples:
- Using latitude of true scale:
$ echo 56.35 12.32 | proj +proj=merc +lat_ts=56.5 3470306.37 759599.90 - Using scaling factor:
$ echo 56.35 12.32 | proj +proj=merc +k_0=2 12545706.61 2746073.80
Note: +lat_ts and +k_0 are mutually exclusive. If both are used, +lat_ts takes
precedence over +k_0.
§Parameters
lat_ts: Latitude of true scalek_0: Scaling factorlon_0: Longitude of originx_0: False eastingy_0: False northingellps: EllipsoidR: Radius of the sphere
§Mathematical Definition
Spheroidal Form
- Forward Projection: $$x = k_0 \cdot R \cdot \lambda$$ $$y = k_0 \cdot R \cdot \psi$$ where $$\psi = \ln\left(\tan\left(\frac{\pi}{4} + \frac{\phi}{2}\right)\right)$$
- Inverse Projection: $$\lambda = x / (k_0 \cdot R)$$ $$\psi = y / (k_0 \cdot R)$$ $$\phi = \frac{\pi}{2} - 2 \cdot \arctan\left(\exp(-\psi)\right)$$
Ellipsoidal Form
- Forward Projection: $$x = k_0 \cdot a \cdot \lambda$$ $$y = k_0 \cdot a \cdot \psi$$ where $$\psi = \ln\left(\tan\left(\frac{\pi}{4} + \frac{\phi}{2}\right)\right) - 0.5 \cdot e \cdot \ln\left(\frac{1 + e \cdot \sin(\phi)}{1 - e \cdot \sin(\phi)}\right)$$
- Inverse Projection: $$\lambda = x / (k_0 \cdot a)$$ $$\psi = y / (k_0 \cdot a)$$ $$\phi = \arctan(\tau)$$ where $$\tau = \tan(\phi)$$
§Further Reading

Trait Implementations§
Source§impl<const C: i64> Clone for MercatorBaseProjection<C>
impl<const C: i64> Clone for MercatorBaseProjection<C>
Source§fn clone(&self) -> MercatorBaseProjection<C>
fn clone(&self) -> MercatorBaseProjection<C>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<const C: i64> CoordinateStep for MercatorBaseProjection<C>
impl<const C: i64> CoordinateStep for MercatorBaseProjection<C>
Source§impl<const C: i64> Debug for MercatorBaseProjection<C>
impl<const C: i64> Debug for MercatorBaseProjection<C>
Source§impl<const C: i64> PartialEq for MercatorBaseProjection<C>
impl<const C: i64> PartialEq for MercatorBaseProjection<C>
Source§impl<const C: i64> ProjectCoordinates for MercatorBaseProjection<C>
impl<const C: i64> ProjectCoordinates for MercatorBaseProjection<C>
impl<const C: i64> StructuralPartialEq for MercatorBaseProjection<C>
Auto Trait Implementations§
impl<const C: i64> Freeze for MercatorBaseProjection<C>
impl<const C: i64> !RefUnwindSafe for MercatorBaseProjection<C>
impl<const C: i64> !Send for MercatorBaseProjection<C>
impl<const C: i64> !Sync for MercatorBaseProjection<C>
impl<const C: i64> Unpin for MercatorBaseProjection<C>
impl<const C: i64> !UnwindSafe for MercatorBaseProjection<C>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more