Enhance WMTS imports by handling styles and tile matrices per layer #356
+50
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
Currently, I do not manage to use some WMTS services correctly :
Requests are not the right ones because
TileMatrix
parameter is wrong due toTileMatrixSet.TileMatrix.Identifier
For instance, when adding a layer from Grand Lyon using the demo app : https://imagerie.data.grandlyon.com/geoserver/grandlyon/gwc/service/wmts?layer=TS2011_nuit&style=raster&tilematrixset=EPSG%3A4326&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=21&TileCol=19&TileRow=4 raises an error
Unknown TILEMATRIX 21
When requesting GetCapabilities, TileMatrixSet.TileMatrix.Identifier is not a simple incremental number but
EPSG:3946:0
so we have to handle this prefix to build the request.Also, there could be multiple styles, multiple tile matrices and formats by layer. So the layer currently displayed in the app right now could not be working.
There was also an issue regarding resolutions that have to be computed regarding max resolution (see OpenLayers example on WMTS).
I tried to manage multiple styles and tile matrices with
sublayers
to be expanded. For now, I search forimage/jpeg
format or fallback to the first format returned in capabilities. This could be improved later if we want to handle multiple formats.The default preset (Swisstopo https://wmts10.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml) is still working with this adding.
Maybe there are still remaining issues on specific cases (i.e EPSG:4326 that is not working, and maybe other layers) but I think the situation is better than it was regarding the 3 french examples that I used. Specific cases could be treated later.
Please tell me what you think about it.
Thanks
Benoît