2

I am trying to add tiles from a GeoServer instance (using GeoWebCache) as an XYZ layer to a QGIS project.

The demo map on the server is here:

https://gis.lmi.is/geoserver/gwc/demo/LMI_Kort?gridSet=EPSG:3857&format=image/png

There are at least two URLS where I can access tiles individually:

The server also provides a TMS endpoint: https://gis.lmi.is/geoserver/gwc/service/tms/1.0.0

I have tried variations of each of those as XYZ sources in QGIS, substituting {z}, {x} and {y} in the place of 9, 408 and 299. I have also tried {-y}, to see if that works. The projection for the project is 3857. In all cases, I can add the layer to QGIS but nothing happens on the map canvas.

What is the correct connection string to use?

Note: I am able to add the layer as WMTS, but there are issues with the rendering. I wanted to see if XYZ tiles would be better. See Image quality and aliasing effects in GeoWebCache WMTS tiles in QGIS for details.

2 Answers 2

3

You need to use this URL https://gis.lmi.is/geoserver/gwc/service/wmts?Service=WMTS&Request=GetCapabilities&Version=1.0.0

For a WMTS, you need to replace after the base URL (all the url before ?) the string with the following Service=WMTS&Request=GetCapabilities&Version=1.0.0

So, in your case, https://gis.lmi.is/geoserver/gwc/service/wmts?layer=LMI_Kort&style=default&tilematrixset=EPSG%3A3857&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix=9&TileCol=299&TileRow=408 becomes https://gis.lmi.is/geoserver/gwc/service/wmts? and after adding the end with my first instruction, you get at the end https://gis.lmi.is/geoserver/gwc/service/wmts?Service=WMTS&Request=GetCapabilities&Version=1.0.0

You paste the URL by going to menu "Layers" > "Add Layer" > "Add WMS/WMTS Layer" > "New" (if you did not already configure "something") and fill the content with the previous URL (see screenshot) and click "OK"

WMTS configuring in QGIS

Then, "Connect" to get a list of layers like below screenshot. Choose one, "Add" and you will see the layer

WMTS layers list

End result in QGIS

QGIS layers demo

PS: except I've illustrated with your case, my answer covers more or less what is in the QGIS WMTS doc https://docs.qgis.org/3.16/en/docs/user_manual/working_with_ogc/ogc_client_support.html#wms-wmts-client. Feel free to visit it as it may help you to better understand

1
  • 1
    Thank you for taking the time to write this detailed answer. I was already able to add the layer as a WMTS, my problem was that there were problems with how it was rendered. This was why I wanted to try the tiles directly. In the end, I solved the problem with the "Zoom to Native Resolution" function on the WMTS layer. See here for details: gis.stackexchange.com/a/375135/64762 Jul 14, 2021 at 13:27
0

The answer seems to be here under "Fonction projecion de Mercator" : http://randochartreuse.free.fr/mobac2.x/mapsources/Islande/Islande-LMI_Kort.bsh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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