MapMath

CHAPTER 04

Map projections — flattening the globe

Why every flat map lies, the math behind Web Mercator and equal-area projections, and how to pick the right projection for your use case.

3 min readfree

You cannot flatten a sphere onto a plane without distortion. Period. This is a topological fact (proved by Gauss's Theorema Egregium). Every projection trades off some properties for others:

optional — skip if familiarrefresher
PropertyDescriptionExample use
ConformalPreserves angles locallyNavigation charts, web maps
Equal-areaPreserves areaPopulation density, choropleth maps
EquidistantPreserves distance from one pointRadar maps, distance rings
CompromiseDistorts everything a littleGeneral reference maps

No projection can preserve all properties simultaneously. The Mercator projection you use every day is conformal — it gets angles right but exaggerates area near the poles.

The choice of projection depends entirely on what the map is for. A navigation chart prioritises angle accuracy so compass headings stay true; a map showing population density by country prioritises area accuracy so visual weight matches real size.

Mercator projection (1569)

Mercator is conformal, which is why it became the navigator's friend — a constant compass heading is a straight line on the map. This property is called a rhumb line: a path that crosses every meridian at the same angle. It made Mercator invaluable for maritime navigation centuries before GPS.

The projection works by wrapping a cylinder around the sphere along the equator, then mathematically "unrolling" it. Latitude lines are stretched horizontally to keep pace with the growing east-west spacing of meridians — but this stretching grows without limit toward the poles, which is why polar regions appear vastly enlarged.

Forward (lat/lon → x/y):

x=Rλx = R \cdot \lambda y=Rln ⁣(tan ⁣(π4+φ2))y = R \cdot \ln\!\left(\tan\!\left(\tfrac{\pi}{4} + \tfrac{\varphi}{2}\right)\right)

(λ and φ in radians; R = Earth's radius)

Inverse (x/y → lat/lon):

λ=xR\lambda = \frac{x}{R} φ=2arctan(ey/R)π2\varphi = 2 \cdot \arctan(e^{y/R}) - \frac{\pi}{2}

The Greenland problem

Mercator inflates polar areas absurdly. Greenland appears roughly the size of Africa — but Africa is ~14× larger. The y-formula uses ln(tan(...)) which grows slowly near the equator and accelerates toward the poles, stretching Greenland far beyond its true size.

The visualization below shows Tissot's indicatrix — circles of equal area placed on the globe, then rendered on Mercator. Near the equator they're circular; toward the poles they become tall ellipses, showing how vertical (north-south) distances are stretched.

Tissot's indicatrix — equal circles on the globe, distorted on Mercator

Equator (0°)60°N

Each circle represents the same area on the globe. Near the poles, Mercator inflates them vertically by a factor of 1/cos(φ). At 60°N that's ×2 — Greenland looks twice as tall as it is.

Why web maps cut off at 85.05°

The Mercator y-formula tends to infinity at the poles (φ = ±90°). Web Mercator clips at ±85.05113° — the latitude where the world becomes a perfect square, making tile math clean.

Worked example

Q: Project Lahore (31.5204° N, 74.3587° E) into Mercator coordinates with R = 6,378,137 m.

Convert to radians:

φ=31.5204×π/180=0.55013 rad\varphi = 31.5204 \times \pi/180 = 0.55013 \text{ rad} λ=74.3587×π/180=1.29797 rad\lambda = 74.3587 \times \pi/180 = 1.29797 \text{ rad}

Apply the formula:

x=6,378,137×1.297978,277,694 mx = 6{,}378{,}137 \times 1.29797 \approx 8{,}277{,}694 \text{ m} y=6,378,137×ln(tan(π/4+0.55013/2))3,727,021 my = 6{,}378{,}137 \times \ln(\tan(\pi/4 + 0.55013/2)) \approx 3{,}727{,}021 \text{ m}

These are the Web Mercator coordinates (EPSG:3857) used internally by Google Maps and OpenStreetMap — roughly 8,277 km east of the prime meridian and 3,727 km north of the equator, in metres.

References

3 sources
  1. [1]

    Snyder, J.P. (1987).

    Map Projections: A Working Manual.”

    USGS Professional Paper 1395

    Chapter 7 covers the Mercator projection in full; Chapter 20 covers Lambert Conformal Conic.

  2. [2]

    Tissot, N.A. (1881).

    Mémoire sur la Représentation des Surfaces et les Projections des Cartes Géographiques.”

    Gauthier-Villars, Paris

    Introduction of Tissot's indicatrix — the distortion ellipse tool used to visualise projection error.

  3. [3]

    Bugayevskiy, L.M. & Snyder, J.P. (1995).

    Map Projections: A Reference Manual.”

    Taylor & Francis

    Broader coverage of projection families including equal-area and azimuthal projections.