vibeproj.projections.mercator

Mercator and Web Mercator projections.

Standard Mercator (ellipsoidal): EPSG:3395 and similar. Web Mercator (spherical pseudo-Mercator): EPSG:3857 — used by all web map tiles.

Classes

Mercator

Ellipsoidal Mercator projection (variant A / 1SP).

WebMercator

Spherical Pseudo-Mercator (EPSG:3857).

Module Contents

class vibeproj.projections.mercator.Mercator

Bases: vibeproj.projections.base.Projection

Ellipsoidal Mercator projection (variant A / 1SP).

name = 'merc'
setup(params: vibeproj.crs.ProjectionParams) dict

Compute derived parameters from projection params.

Called once at construction time. Returns a dict of computed params that will be passed to forward/inverse.

forward(lam, phi, params, computed, xp)

Forward projection: geographic (lon, lat in radians) -> projected (x, y in meters).

lam: longitude relative to central meridian (radians), array phi: latitude (radians), array Returns (x, y) in projection-native units (before false easting/northing and scale).

inverse(x, y, params, computed, xp)

Inverse projection: projected (x, y) -> geographic (lon, lat in radians).

x, y: projection-native units (after removing false easting/northing and scale). Returns (lam, phi) in radians, with lam relative to central meridian.

class vibeproj.projections.mercator.WebMercator

Bases: vibeproj.projections.base.Projection

Spherical Pseudo-Mercator (EPSG:3857).

Uses spherical formulas with WGS84 semi-major axis. This is the projection used by virtually all web mapping platforms.

name = 'webmerc'
setup(params: vibeproj.crs.ProjectionParams) dict

Compute derived parameters from projection params.

Called once at construction time. Returns a dict of computed params that will be passed to forward/inverse.

forward(lam, phi, params, computed, xp)

Forward projection: geographic (lon, lat in radians) -> projected (x, y in meters).

lam: longitude relative to central meridian (radians), array phi: latitude (radians), array Returns (x, y) in projection-native units (before false easting/northing and scale).

inverse(x, y, params, computed, xp)

Inverse projection: projected (x, y) -> geographic (lon, lat in radians).

x, y: projection-native units (after removing false easting/northing and scale). Returns (lam, phi) in radians, with lam relative to central meridian.