Create a WeoGeo Tilepack from ArcGIS Tiles

A couple of months ago, Dan Dye at WeoGeo posted about work he had done to facilitate creating WeoGeo tile packs from MBTiles databases. Recently, I had the need to do the same with ArcGIS tiles. As Dan explained, WeoGeo uses a ZYX structure in their tile packs. This matched up nicely with the Level/Row/Column structure used by ArcGIS. WeoGeo supports either WGS84 (EPSG:4326) or Spherical Mercator (EPSG:3857) as spatial references for tile packs. In my case, I used the latter. My preferred way of creating tiles from ArcGIS products is to use Arc2Earth. While Arc2Earth does directly export to the WeoGeo structure, the tiles are watermarked with a WeoGeo logo, which was not needed in this case. Arc2Earth also exports to the ArcGIS structure, so a simple script to convert to the WeoGeo structure is all that was needed.

Arc2Earth settings to create ArcGIS Tiles

So I wrote a Python script to migrate from the ArcGIS structure to the WeoGeo structure. It primarily uses file system operations with a little bit of logic to unroll the hex-based file naming convention used by Esri. That script can be found here on GitHub. Be sure to check out the README for the current state of the script. The biggest potential gotcha is that it doesn’t current use the ArcGIS conf.xml file so, if your ArcGIS cache contains non-consecutive zoom levels (0-2 and 4, for example), it will throw this script off. This has to do with the peculiarities in how Esri names the levels (Z) in their format. I’ll be making this more robust in subsequent versions, along with with some work to provide a more complete workflow.