stac-extensions / web-map-links

Allows to provide links to web maps for visualization purposes
Apache License 2.0
18 stars 2 forks source link

WMTS href contents #5

Closed rowanwins closed 1 year ago

rowanwins commented 2 years ago

Currently for the WMTS href field it says

REQUIRED. Link to the WMTS, without any WMTS specific query parameters.

WMTS implementations can be quite variable in how they structure their URLs (eg a geoserver WMTS endpoint vs an Esri WMTS endpoint).

Looking at some specific examples

The root of this Geoserver WMTS might be considered https://geoserver.imas.utas.edu.au/geoserver/gwc/service/wmts, however when you access the GetCapabilities document you see that tiles accessed via https://geoserver.imas.utas.edu.au/geoserver/gwc/service/wmts/rest/{layer}{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format=image/png

Compared with this Esri WMTS where the root might be considered https://services.ga.gov.au/gis/rest/services/AREMI_Buildings_WM/MapServer/WMTS/, however when you access the GetCapabilities document you see that tiles accessed via http://services.ga.gov.au/gis/rest/services/AREMI_Buildings_WM/MapServer/WMTS/tile/1.0.0/{layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png

The URL construction patterns to access the tiles are quite different. Guessing what the root url that you ought to store in the STAC item might be fiddily, and there then might be uncertainty for developers knowing how to reconstruct tile urls based on that.

Perhaps one option is to make the href field point to the GetCapabilities, this combined with the wmts:layer field, that gives the developer a consistent way to find the tiles endpoint (albiet with the need to parse the WMTS GetCapabilities info).

WMTS is fun :)

m-mohr commented 2 years ago

Indeed, there seems to be a need for clarification. The specification was used with mapping libraries in mind, so the URL would the URL that you also simply pass to OpenLayers and Leaflet for example. As there is no native Leaflet implementation, I just based it on OpenLayers for now. So the href should be the URL that you pass into the capabilities class of OpenLayers for example. It appends the corresponding query parameters for the request then. From the capabilities the client library would get the different Tile URLs you mentioned above, so I don't see an issue there. I'm not really sure how this is called though and how I can better clarify. Any suggestions?

cholmes commented 2 years ago

I think you maybe just need to clarify that the link should be to the WMTS capabilities document. And then also clarify that clients are expected to parse the capabilities document and use the wmts:layer field to construct the appropriate tile requests.

m-mohr commented 1 year ago

Clarified.