[GIS] OSMDroid app using custom ArcGIS Tile Server – tiles are shuffled

androidarcgis-serveropenstreetmaposmdroidtile-server

I am developing an android mapping app using OSMDroid. I am attempting to use free custom aerial imagery, completely independent of Google and/or Bing APIs. Please, do not propose any solution that uses their mapping APIs.

I have managed to display satellite imagery by including this code:

mapView.setTileSource(TileSourceFactory.MAPQUESTAERIAL);

but Tile Server does not offer tiling above 11 zoom and I need to get closer than that (say 15-16?).

Using ArcGIS tile server, I manage to display satellite imagery even to 16 layer zoom level, but tiles are shuffled around.

mapControl = (MapController) mapView.getController();
mapControl.setZoom(11);
String[] urlArray = {"http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/"};
mapView.setTileSource(new XYTileSource("ArcGisOnline", null, 0, 18, 256, ".png",urlArray ));

Basemap tiles are shuffled and do not correspond to lat/lon, but overlay is ok.

Basemap tiles are shuffled

Best Answer

Using ArcGIS tile server, I manage to display satellite imagery even to 16 layer zoom level, but tiles are shuffled around. .... Basemap tiles are shuffled and do not correspond to lat/lon, but overlay is ok.

According to the osmdroid Map Sources page, ESRI map services use the ZYX URL tile numbering format instead of slippy maps' ZXY that osmdroid uses.

ZYX - Some map tile servers, such as some ESRI based products, use the Zoom/Y/X URL format. Since it's trivial to convert to ZXY, support for this format is easy to setup on osmdroid. We currently have at least one map source that uses this mechanism (see USGS maps).

Did you account for that? It would seem to explain your shuffled image... you need to convert according to the osmdroid GitHub page.

Related Question