Lably
Skip to content

Web Mercator projection

  • 5 min read
  • 3 chapters

Related on Lably

Through Map projection, World Wide Web and Scale (map)

Properties

Web Mercator is a slight variant of the Mercator projection, one used primarily in Web-based mapping programs. It uses the same formulas as the standard Mercator as used for small-scale maps. However, the Web Mercator uses the spherical formulas at all scales whereas large-scale Mercator maps normally use the ellipsoidal form of the projection. The discrepancy is imperceptible at the global scale but causes maps of local areas to deviate slightly from true ellipsoidal Mercator maps at the same scale.

While the Web Mercator's formulas are for the spherical form of the Mercator, geographical coordinates are required to be in the WGS 84 ellipsoidal datum. This discrepancy causes the projection to be slightly non-conformal. General lack of understanding that the Web Mercator differs from standard Mercator usage has caused considerable confusion and misuse. Mistaking Web Mercator for the standard Mercator during coordinate conversion can lead to deviations as much as 40 km on the ground. For all these reasons, the United States Department of Defense through the National Geospatial-Intelligence Agency has declared this map projection to be unacceptable for any official use.

Unlike most map projections for the sphere, the Web Mercator uses the equatorial radius of the WGS 84 spheroid, rather than some compromise between the equatorial and polar radii. This results in a slightly larger map compared to the map's stated (nominal) scale than for most maps.

Formulas

Formulas for the Web Mercator are fundamentally the same as for the standard spherical Mercator, but before applying zoom, the "world coordinates" are adjusted such that the upper left corner is (0, 0) and the lower right corner is ( 2zoom level−1, 2zoom level−1): x=⌊12π⋅2zoom level(π+λ)⌋ pixelsy=⌊12π⋅2zoom level(π−ln⁡[tan⁡(π4+φ2)])⌋ pixels where λ is the longitude in radians and φ is geodetic latitude in radians.

Because the Mercator projects the poles at infinity, a map using the Web Mercator projection cannot show the poles. Services such as Google Maps cut off coverage at 85.051129° north and south. This is not a limitation for street maps, which is the primary purpose for such services. The value 85.051129° is the latitude at which the full projected map becomes a square, and is computed as φ given y = 0: φmax=[2arctan⁡(eπ)−π2]

Spherical and ellipsoidal mix

The projection is neither strictly ellipsoidal nor strictly spherical. EPSG's definition says the projection "uses spherical development of ellipsoidal coordinates". The underlying geographic coordinates are defined using the WGS84 ellipsoidal model of the Earth's surface, but are projected as if defined on a sphere. This practice is uncontroversial for small-scale maps (such as of the entire world), but has little precedent in large-scale maps (such as of a city or province).

Advantages and disadvantages

Web Mercator is a spherical Mercator projection, and so it has the same properties as a spherical Mercator: north is up everywhere, meridians are equally spaced vertical lines, angles are locally correct (assuming spherical coordinates), and areas inflate with distance from the equator such that the polar regions are grossly exaggerated. The ellipsoidal Mercator has these same properties, but models the earth as an ellipsoid.

Unlike the ellipsoidal Mercator, however, the Web Mercator is not quite conformal. This means that angles between lines on the surface will not be drawn to the same angles in the map, although they will not deviate enough to be noticeable by eye. Lines deviate because Web Mercator specifies that coordinates be given as surveyed on the WGS 84 ellipsoidal model. By projecting coordinates surveyed against the ellipsoid as if they were surveyed on a sphere, angular relationships change slightly. This is standard practice on the standard spherical Mercator projection, but unlike Web Mercator, the spherical Mercator is not normally used for maps of local areas, such as street maps, and so the accuracy of positions needed for plotting is typically less than the angular deviation caused by using spherical formulas. The benefit the Web Mercator gains is that the spherical form is much simpler to calculate than the ellipsoidal form, and so requires only a fraction of the computing resources.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication