# What's the accuracy of Web Mercator EPSG:3857?

Are there any references on the accuracy or (min/max/avg) error of Web Mercator when it comes to e.g. distance calculations?

For the sake of completeness, I haven't found any reference to the accuracy Web Mercator. In contrast, spatial computations in WGS-84 projection are, due to Charles Karney, highly accurate as described in http://arxiv.org/abs/1109.4448 This, however, requires Gnomonic projection of coordinates for point to line projections which is very costly in GIS software. An alternative is the use of de-facto standard Web Mercator which must be questioned if accuracy is sufficient.

• Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq. – underdark Mar 12 '16 at 16:02

As a first step, you could look at the distortions of the Mercator projection, which is a conformal projection. Distance with this projection is only correct along the equator, then the error increase with the latitude. Indeed, as you can see on a global view, the parallels keep the same legnth on the maps. For example, the horizontal scale factor, which is 1 at the equator, is equal to 1.15 at a latitude of 30° (15% error), 2 at a latitude of 60° and 11.5 at a latitude of 85° (scale factor 1/cos(latitude) )

Web Mercator uses WGS 84 Lat/Long as if they were angles on a sphere, presumably to reduce the processing time. This leads to more distortions, especially when you move away from the equator, that make the Web Mercator non-conformal. However,the impact of the "pseudo-sphericity" on distance measurements at high latitude is a lot smaller than the design of the Mercator projection.

The same reasoning holds for area distortion.

• Thanks for the answer. Do you have a reference/links to e.g. literature or examplary calcluations to these error rates? Would you say that spatial computations for distance or point to line projections are meaningful with Web Mercator at all? – sema Mar 12 '16 at 20:36
• I would never use Web Mercator to compute a distance, except maybe very near the equator. If possible, try to use a local CRS which will also be distorted, but less. If you need global scale distance measurement and computation time is a real issue, then assume that the earth is a sphere. – radouxju Mar 12 '16 at 21:12
• Thanks, that confirms my impression so far. I think that I approach it with a try to estimate the error for point to line projections analytically based on your hints (error rates) but will definitely calculate the deviations for some examples to get an overview. – sema Mar 12 '16 at 21:20

You can study the error by making SQL queries with Spatialite-gui which has a function ST_Length with a description at https://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html

return the length of c (measured in meters). If the use_ellipsoid argument is set to TRUE the precise (but slower) length will be computed on the Ellipsoid, otherwise will be computed on the Great Cicle (approximative, but faster).

Examples:

• Example one, east-west oriented linestring, length one degree, located at latitude 20°N

Great circle length:

``````select ST_Length(ST_GeomFromText('LINESTRING (0 20,1 20)',4326),0)
104489.040752
``````

Length along ellipsoid:

``````select ST_Length(ST_GeomFromText('LINESTRING (0 20,1 20)',4326),1)
104646.930934
``````

Then the length when the linestring is projected first into EPSG:3857:

``````select ST_Length(ST_Transform(ST_GeomFromText('LINESTRING (0 20,1 20)',4326),3857))
111319.490793
``````

Difference to length along ellipsoid 6673 m.

• Example two, east-west oriented linestring, length one degree, located at latitude 60°N

Great circle length:

``````select ST_Length(ST_GeomFromText('LINESTRING (0 60,1 60)',4326),0)
55597.010615
``````

Length along ellipsoid:

``````select ST_Length(ST_GeomFromText('LINESTRING (0 60,1 60)',4326),1)
55799.470393
``````

Then the length when the linestring is projected first into EPSG:3857:

``````select ST_Length(ST_Transform(ST_GeomFromText('LINESTRING (0 60,1 60)',4326),3857))
111319.490793
``````

Difference to length along ellipsoid 55520 m.

You can do similar queries with PostGIS but you must use "geography" http://postgis.net/docs/ST_Length.html.