Skip to content

Instantly share code, notes, and snippets.

@geobabbler
Created October 4, 2012 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geobabbler/3833833 to your computer and use it in GitHub Desktop.
Save geobabbler/3833833 to your computer and use it in GitHub Desktop.
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