WMTS Service not working - ignoring Dimension Attribute

546
2
12-02-2022 02:43 AM
MichaelMoor
New Contributor II

hi folks

im trying to implement a public wmts layer (https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml).

with this code:

 

let wmtsService = AGSWMTSService(url: URL(string("https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml")))

//load the WMTS service to access the service information
wmtsService.load { (error) in
    if let error = error {
        DDLogError("Failed to load wmts basemap. \(error)")
    } else if let layerInfo = wmtsService.serviceInfo?.layerInfos.first(where: { $0.layerID == "ch.swisstopo.pixelkarte-farbe"}) {
        let wmtsLayer = AGSWMTSLayer(layerInfo: layerInfo)
        let basemap = AGSBasemap(baseLayer: wmtsLayer)
        
        completionHandler(basemap)
    }
}

 

The WMTS Service is loading without error but the Basemap doesn't display anything.

So i debugged it with Postman. The Layer is trying to load the tiles from an URL like this:

https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default//21781/20/58/70.jpeg

causing a 404 because the <Time> parameter is empty.

The correct URL would be https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/21781/20/58/70.jpeg

How can i force the WMTSLayer to provide the "current" keyword to the <Time> parameter?

Thanks a lot!

Mike

0 Kudos
2 Replies
Ting
by Esri Contributor
Esri Contributor

Unfortunately, multidimensional info like "time", "elevation", "band", etc., was originally supported in 10.x versions, but not in the 100.x Runtime SDK. See a similar post at here.

We are aware of this request and evaluating the importance of OGC WMTS spec conformance, and it would probably go into one of the 2023 releases of 200.x version of the SDK. Thanks for your patience.

0 Kudos
MatveiStefarov
Esri Contributor

Good news – Runtime 200.1 was just released this morning. WMTS layers with dimensional data are now supported. The default dimension value is used if provided by the service. Otherwise, the first value listed is used. This should allow you to open any layer on the Swisstopo WMTS service and see the current data.