pub struct WebMercatorProjection { /* private fields */ }Expand description
§Web Mercator / Pseudo Mercator Projection
The Web Mercator / Pseudo Mercator projection is a cylindrical map projection. This is a variant of the regular Mercator projection, except that the computation is done on a sphere, using the semi-major axis of the ellipsoid.
From Wikipedia:
This projection is widely used by the
Web Mercator,Google Web Mercator,Spheroidal Mercator,WGS 84 Web Mercator[1]orWGS 84/Pseudo-Mercatoris a variant of the Mercator projection and is the de facto standard for Web mapping applications. […] It is used by virtually all major online map providers […] Its official EPSG identifier is EPSG:3857, although others have been used historically.
Classification: Cylindrical (non-conformal if used with an ellipsoid)
Available forms: Forward and Inverse
Defined area: Global
Alias: webmerc
Domain: 2D
Input type: Geodetic coordinates
Output type: Projected coordinates
§Usage
$ echo 2 49 | proj +proj=webmerc +datum=WGS84
222638.98 6274861.39§Parameters
Note: All parameters for the projection are optional, except the ellipsoid definition, which is WGS84 for the typical use case of EPSG:3857. In which case, the other parameters are set to their default 0 value.
ellps: Ellipsoidlon_0: Longitude of originx_0: False eastingy_0: False northing
§Mathematical Definition
The formulas describing the Mercator projection are adapted from G. Evenden’s libproj manuals.
Forward Projection:
$$ x = λ $$ $$ y = ln(tan(π/4 + φ/2)) $$
Inverse Projection:
$$ λ = x $$ $$ φ = π/2 - 2 * atan(exp(-y)) $$
§Further Reading

Trait Implementations§
Source§impl Clone for WebMercatorProjection
impl Clone for WebMercatorProjection
Source§fn clone(&self) -> WebMercatorProjection
fn clone(&self) -> WebMercatorProjection
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebMercatorProjection
impl Debug for WebMercatorProjection
Source§impl PartialEq for WebMercatorProjection
impl PartialEq for WebMercatorProjection
Source§impl ProjectCoordinates for WebMercatorProjection
impl ProjectCoordinates for WebMercatorProjection
impl StructuralPartialEq for WebMercatorProjection
Auto Trait Implementations§
impl Freeze for WebMercatorProjection
impl !RefUnwindSafe for WebMercatorProjection
impl !Send for WebMercatorProjection
impl !Sync for WebMercatorProjection
impl Unpin for WebMercatorProjection
impl !UnwindSafe for WebMercatorProjection
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