Select to view content in your preferred language

Finding coordinates of tiles

3840
1
Jump to solution
02-04-2013 11:59 AM
MattLane
Frequent Contributor
I'm looking to represent the most viewed tiles from my ArcGIS Server service, which I can get from my logfiles, in a map. Something along the lines of some of the examples found here http://content.stamen.com/log_maps.

However, I am not sure how to get either the origin or centroid of a given tile. This page helps conceptually http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/, but there are some differences that would probably require a considerable amount of rewrite of the python file.

1. My cached service is in state plane feet, not web mercator
2. ESRI doesn't use Google, TMS, or Quadtree indexing of tiles (although they are similar to TMS?)
3. I believe the origin of the cache is relative to the map extent at time of publishing, but I'm not sure

Anyone know of a way to do this?

Matt
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MattLane
Frequent Contributor
I was thinking too hard. The Rest info for the cached service had all the details I needed.

Tile url's have the following scheme
[zoom]/[ty]/[tx]


The cached details on the Rest page give me origin coordinates and resolution for each scale/zoom.

To get the upper left corner of a tile, I can use the following equations
x = xorigin + (tx * 256 * res) y = yorigin - (ty * 256 * res)


To get centroid for a tile, I just need to offset that by half the width/height of a tile
x = xorigin + (tx * 256 * res) + (128 * res) y = yorigin - (ty * 256 * res) - (128 * res)

View solution in original post

0 Kudos
1 Reply
MattLane
Frequent Contributor
I was thinking too hard. The Rest info for the cached service had all the details I needed.

Tile url's have the following scheme
[zoom]/[ty]/[tx]


The cached details on the Rest page give me origin coordinates and resolution for each scale/zoom.

To get the upper left corner of a tile, I can use the following equations
x = xorigin + (tx * 256 * res) y = yorigin - (ty * 256 * res)


To get centroid for a tile, I just need to offset that by half the width/height of a tile
x = xorigin + (tx * 256 * res) + (128 * res) y = yorigin - (ty * 256 * res) - (128 * res)
0 Kudos