[GIS] How to EPSG:3857 be in meters

coordinate systemepsg

It is said that unit of measure for EPSG:3857 is the metre.

How it can be, if the range of these coordinates is

Projected bounds:
-20,026,376.39 -20,048,966.10
20,026,376.39 20,048,966.10

(from the same source).

This means approximately a square of 40,000 x 40,000 kilometers. This length is correct for the equator, but how can it be in general if the circumference at high latitudes is smaller?

UPDATE

The length of the parallel at latitude 85.06 is

$R_earth * cos(85.06) * 2 * \pi$ = 3454 kilometers and it is << 40000

My question is: is this parallel projected onto the entire upper edge of the 40000 x 40000 square or onto part of it 3453m long?

enter image description here

In the first case the unit of measure IS NOT METRES, since it varies from metres at the origin to 3453/40000 = 9 centimeters at parallel 85.05.

Best Answer

It is a projection of a spheroid on a flat surface. Every projection has strengths and weaknesses and will preserve some elements of direction, distance or area better or worse than others (which is why careful selection of a suitable, that is local where possible, projection is so important).

So, while the unit of measurement in EPSG:3857 is indeed meters, as you have correctly spotted, distance measurements become increasingly inaccurate away from the equator. All Mercator-style projections have the same defect as they move away from their reference point. But, where they are not global, the error can be minimized by appropriate positioning of this point. It is for this reason there are so many UTM zones for instance. Other projections have different strengths and weaknesses depending on use (e.g. navigation vs cartography).

So what's the point of EPSG:3875? To understand that, you must understand that it was designed for web mapping and is square so that the map tiles fit nicely into a powers-of-two schema as you prgress through each sucessive zoom-level. This is EPSG:3857's particular strength. It is not designed for distance and area calculations. There are many much better alternatives. If you are not using the data for web mapping, I would strongly encourage you to consider some other projection that is more suitable to your use-case, especially if you intend to do distance calculations (or, in that event, cast your data in geographic coordinates and not Cartesian coordinates and use the Haversine formula to calculate distances on a sphere).

EDIT (re comments):
The diagram added to the OP's question basically is a diagram of my first paragraph, viz that the project introduces distortion. For more information on how the Earth is projected in this case see here. The unit of measurement for Web Mercator is NOT pixels but meters. The OP's question results from a misunderstanding. Vector data can also be projected in Web Mercator. In this case there are no pixels. So you see, the concept of a unit of measurement as pixels has no relationship to the real world. However, pixels-per-meter is relevant for a raster as this tells us the resolution of the image. BUT the unit of measurement is still meters (in this case) and not pixels.

Where the confusion for the OP possibly arises is the use of Web Mercator at various zoom levels where tiles are usually set to be 256x256 pixels and a given zoom level has a certain nominal ground resolution, so some web mapping applications use screen pixels as a means of calculating distance. But, the pixels are interpreted as a meters-distance in relation to the zoom level (and possibly latitude).