I need to get the tile for the coordinates I have in EPSG:4326 format.
So, I tried to transform the coordinates into EPSG:3857 format according to the Slippy Map Wiki.

Following the example provided, I used proj4 instead of manually coding the mathematical expressions.

However, the wiki states that the x and y values are in EPSG:3857 format, but the values seem very different from what I found using this calculator.

So, my question is:
Are the x_EPSG:3857 and y_EPSG:3857 values on the wiki really in EPSG:3857 format?
If not, what format are the x and y values in?

(Wrap this entire message in a huge â€śas far as I understandâ€ť.)

No, the x_EPSG:3857 and y_EPSG:3857 values are not really in EPSG:3857 format.

EPSG:3857 tries to be a projection, albeit quite a bizarre one. That means that its output is supposed to be in some sort of length units, typically meters. It achieves this by taking angles (arrived at by means which make little geodetic sense) in radians, and multiplying them by the average radius of the Earth. This gives somewhat sane x and y values at the equator (i.e, you get roughly the 40-million-meter x range that youâ€™d expect) but move away from the equator and the values stop making any sense whatsoever.

Now, if you are computing tile numbers, the next step would probably be to divide the x and y coordinates by the projected circumference of the earth. This effectively cancels out the multiplication by the radius (and a factor Ď€), so the tile-number calculations on the wiki simple leave out these steps.

In other words, if you take the x_EPSG:3857 and y_EPSG:3857 value from the wiki, convert the x value to radians (the y value is already in radians!) and multiply by 6378137 (average radius of the Earth), you should get the same numbers as you get from a â€śrealâ€ť EPSG:3857 conversion.

@turepalsson I understand your point. Thank you for the detailed and kind response

However, it seems like there is a difference between the â€śrealâ€ť EPSG:3857 and the x_EPSG:3857 from the wiki. In that case, shouldnâ€™t the notation be different?