0

I have written an iOS app which can display a number of different layers on a Google Map. I am trying to add another layer which works fine on ArcGIS but I can't get it to work in my app.

There are no API keys or logins or anything required by the service.

Here is the capabilities reference XML.

Here it is working on ArcGIS Online:

enter image description here

enter image description here

Based on the information in the capabilities XML I have compiled this template URL:

https://gisbasemap.ecan.govt.nz/arcgis/rest/services/Imagery/Canterbury_Imagery_1990_1994/MapServer/WMTS/tile/1.0.0/Imagery_Canterbury_Imagery_1990_1994/default/default028mm/{z}/{x}/{y}

And here is a URL at a location and zoom that I would expect to return a tile:

https://gisbasemap.ecan.govt.nz/arcgis/rest/services/Imagery/Canterbury_Imagery_1990_1994/MapServer/WMTS/tile/1.0.0/Imagery_Canterbury_Imagery_1990_1994/default/default028mm/18/256785/166329

If I can get this to return a tile in a web browser I know I can get it to work in my app.

Have I misinterpreted the capabilities XML or is this something that is not possible in this case (ie. access only from ArcGIS Online)?

1

By looking from the information of the map layer from here: https://gisbasemap.ecan.govt.nz/arcgis/rest/services/Imagery/Canterbury_Imagery_1990_1994/MapServer

You have stated the correct WMS/WMTS Capabilities XML link.

You can use the image endpoint like this (as it is a common tileserver response from ArcGIS Map Server): https://gisbasemap.ecan.govt.nz/arcgis/rest/services/Imagery/Canterbury_Imagery_1990_1994/MapServer/tile/{TileZoom}/{TileRow}/{TileCol}

For example: https://gisbasemap.ecan.govt.nz/arcgis/rest/services/Imagery/Canterbury_Imagery_1990_1994/MapServer/tile/12/1500/580

For your implementation (could be something like this) using Google Maps SDK iOS (I am not an iOS/Android Developer), as I referred it from here:

class ViewController: UIViewController {
let urls = { (x: UInt, y: UInt, zoom: UInt) -> NSURL in
    let url = "https://gisbasemap.ecan.govt.nz/arcgis/rest/services/Imagery/Canterbury_Imagery_1990_1994/MapServer/tile\(zoom)/\(x)/\(y)"
    print(url)
    return NSURL(string: url)!
}
  • I haven't cracked this yet. Tried your template URL above. Could it be an issue with reference systems (EPSG:2193 in the capabilities doc vs EPSG:4326 expected by Google)? – That Guy Oct 20 '18 at 2:16
  • You might need to convert to a suitable projection. – Kyros Koh Oct 23 '18 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.