3

I created a custom web TileServer app that serves map tiles using a specific url in the form

localhost/2/{z}/{x}/{y}.png

z, x, y are tile coordinates (like for instance in OpenLayers or Google)

How can I add a layer from this tileserver to QGIS?

  • 1
    If you go to the Browser Panel (if it's not enabled, you can go to the menubar View > Panels > Browser Panel), right-click the Tile Server (XYZ), select New connection..., you can then enter your tile coordinates which should then load as a layer :) – Joseph Nov 16 '17 at 10:37
3

As @joseph points out, the XYZ tile provider will do what you’re after.

This was introduced in QGIS 2.18. I’m not sure if this has been back ported to any older versions like 2.14

I used it with a local tile cacheing proxy I wrote in Python. This was so I could use base maps when my internet connection goes down.

Be aware that that QGIS has tile cacheing built in, and this also applies to the XYZ provider.

Last time I looked at the QGIS code, it seems QGIS caches the 256 most recent tiles. And I don’t know of any way to clear this cache, other than restarting QGIS.

So if you change your tiles and wonder why you’re still getting ‘stale’ tiles in QGIS, that’s why ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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