Skip to content

Instantly share code, notes, and snippets.

Created October 4, 2012 14:24
What would you like to do?
Additional function for MapTiler to calculate ArcGIS tile coordinates
def AgsTile(self, tx, ty, zoom):
#Converts TMS tile coordinates to ArcGIS Tile coordinates
xhex = hex(tx)
yhex = hex((2**zoom - 1) - ty)
xhex = xhex.replace("0x", "")
yhex = yhex.replace("0x", "")
xhex = "C" + xhex.zfill(8)
yhex = "R" + yhex.zfill(8)
return xhex, yhex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment