Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance WMTS imports by handling styles and tile matrices per layer #356

Merged

Conversation

benoitblanc
Copy link
Contributor

Hi,

Currently, I do not manage to use some WMTS services correctly :

Requests are not the right ones because TileMatrix parameter is wrong due to TileMatrixSet.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 for image/jpeg format or fallback to the first format returned in capabilities. This could be improved later if we want to handle multiple formats.

image

image

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

@manisandro
Copy link
Member

Thanks for the PR. I think best is to merge it and then collect feedback. Regarding format, perhaps png is preferrable due to potential transparency?

@manisandro manisandro merged commit c47aed5 into qgis:master Feb 19, 2025
2 checks passed
@manisandro
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants