0
votes

I feel like this question has been answered before, but I'm off track somehow. I have the URL of a tile (see below): I see that the zoom level is 6, the 33th tile towards the east and 20th tile towards the south. My question is, can I deduct the lat/long (web mercator) coordinates of this tile using said numbers (33 / 20)?

https://heatmap-external-c.strava.com/tiles/all/hot/6/33/[email protected]?v=19

tile

1

1 Answers

0
votes

As stated in the tags of the question, the linked map is rendered via mapbox GL. In the mapbox docs, I found a reference to the OSM Slippy Map Tilenames specification which in turn provides the method with which to transform tilenames to lat long coordinates and vice versa. The following pseudocode answers the question.

Tile numbers (xtile, ytile) to lon./lat for a given zoom level (zoom)

n = 2 ^ zoom
lon_deg = xtile / n * 360.0 - 180.0
lat_rad = arctan(sinh(π * (1 - 2 * ytile / n)))
lat_deg = lat_rad * 180.0 / π

Btw: this type of question is more commonly found on gis.stackexchange.com