# How to get WMTS tile coordinates?

What can I do with the given information: I don't know where I am in the World having some particular tile. It's only an ocean (or sea).

I know, the viewing scale is 36111.909643 and current zoom is 14. Am I able, using the naming convention to guess what would be it's absolute coordinates? I'm not sure about the projection but may choose something later if only I knew what's the region of these waters. It's a guess game.

How to take this approach? How to calculate it? Here I have info about the systematics of this "World_Topo_Map" service.

https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer

How can I get to lon/lat for center of a particular tile?

Here's similar for google: Calculate lat lon bounds for individual tile generated from gdal2tiles but where to put the tile IDs in that formula?

EDIT

I've found a formula for R (and many other languages) but how can I be sure the precision is correct for this particular service? Looking at the globe it's quite there.

# tile formula
num2deg <- function(xtile, ytile, zoom) {
n = 2.0 ** zoom
lon_deg = xtile / n * 360.0 - 180.0
lat_rad = atan(sinh(pi * (1 - 2 * ytile / n)))
return (list(lat=lat_deg, lon=lon_deg))
}

num2deg(8141,5210,14)

I mean I'd need to have a chance of including the projection Spatial Reference: 102100 (3857) for this service in some way.

• WMS don't have tile coordinates Commented Jun 6, 2019 at 8:01