ArcGIS Server: Creating Adapter Between REST Interface and WMS/TMS

arcgis-serveropenstreetmaptile-map-service

I'm trying to use imagery available via the ArcGIS REST tile cache interface, however the tool I'm using, JOSM, only supports WMS or TMS. In addition the data from the ArcGIS server is in a "special" projection, Virginia Lambert Conformal Conic, which doesn't have an ESRI or EPSG wkid but does have WKT provided by the server.

Is there a way using free or open source tools to convert the tiles available from the server to WMS/TMS? I know this would involve downloading multiple tiles, then mosaicking and reprojecting them to create tiles suitable for WMS/TMS. I've come across MapServer and GeoServer, which seem very capable, but I wouldn't know where to begin, so any pointers would be helpful.

The server I'm interested in is here: http://gismaps.virginia.gov/arcgis2/rest/services/VBMP2006_2007/MapServer

Best Answer

Yes, it should be possible to do this using the GDAL_WMS driver from GDAL. There is even an example at that page that points to another ArcGIS REST instance. However, I have not been able to make the concept work against this particular VBMP server. Against a slew of other ArcGIS servers with global-mercator output, no problem.

I believe I do not have the layer extents properly defined, or the tile levels, because I keep generating TMS requests that the server cannot respond to. Since I'm used to working with Spherical Mercator TMS requests, ones like this for TMS addresses in a local projection don't make much sense to me- http://gismaps.virginia.gov/arcgis2/rest/services/VBMP2006_2007/MapServer/tile/0/83/68.jpg.

Below is the XML file I put together from the Service metadata page - http://gismaps.virginia.gov/arcgis2/rest/services/VBMP2006_2007/MapServer. You may be able to get some assistance in making this work from the GDAL developer forum. Once GDAL can properly access the service, you can point MapServer (the original one) at the XML file and run a WMS service that can reproject the data from EPSG:3698 to EPSG:900913 (or whatever code is now used).

<GDAL_WMS>
  <Service name="TMS">        
  <ServerUrl>http://gismaps.virginia.gov/arcgis2/rest/services/VBMP2006_2007/MapServer/tile/${z}/${y}/${x}.jpg</ServerUrl>
    <Layer>VBMP</Layer>
    <Format>jpg</Format>
    <Version>1.1.1</Version>
  </Service>
  <DataWindow>
    <UpperLeftX>-384269.977874641</UpperLeftX>
    <UpperLeftY>476583.633639972</UpperLeftY>
    <LowerRightX>404548.778455541</LowerRightX>
    <LowerRightY>-48883.4062351487</LowerRightY>
    <TileLevel>13</TileLevel>
    <TileCountX>1</TileCountX>
    <TileCountY>1</TileCountY>
    <YOrigin>top</YOrigin>
  </DataWindow>
  <Projection>EPSG:3968</Projection>
  <BlockSizeX>512</BlockSizeX>
  <BlockSizeY>512</BlockSizeY>
  <BandsCount>3</BandsCount>
  <Cache />
</GDAL_WMS>

Good luck.

Related Question