xyz to QGIS

Using OpenStreetMap Basemaps with QGIS 3.0

QGIS 3 is a new wave of open source GIS. Not only is it extremely quick and efficient, allowing you to use almost every type of geospatial data you can throw at it, but it also includes a 3D renderer and ways to export your creations straight to the web. And let’s not forget the HUGE amount of tools it comes with out of the box.

But it has only been out a couple of days and is missing the good old “Quick Map Tools” which we have all become accustomed to, allowing us to easily bring in OpenStreetMap, Stamen, and other background maps with ease. You may have read that you can enable them by using xyz tiles, but, if you are like me, this might as well say, “Stick cheese in your keyboard and twiddle it a little.” As an average GIS user, I have no idea what an xyz tile server is, and, unless you need one, you probably won’t know either. So good news: I’ve put together a little blog for you to get your services back with ease.

Here’s how:
1 – Go to https://wiki.openstreetmap.org/wiki/Tile_servers 

                                                                             Open the OSM wiki
2 – You’ll see that there is a column “tiles url.” These are the xyz tile web addresses you need to make this work.

                                                                               xyz tile addresses
3 – Open QGIS (3.0) and ensure your browser window is open. You will see the xyz tile option about three-quarters the way down the list.

                                                                           xyz tile option

4 – Select the “new connection” option, and, you guessed it, we are going to use the information from the web page and put it into the relevant boxes. ONE IMPORTANT NOTE: Ensure you remove the “$” symbols before copy and pasting them over.

5 – Click okay, and away you go! 

                                                                                          Voila!

Now that you know how, you can go through the list and add the rest of the services.

Layer xyz web URL
OpenStreetMap’sÿStandard tile layer https://a.tile.openstreetmap.org/${z}/${x}/${y}.png OR https://b.tile.openstreetmap.org/${z}/${x}/${y}.png OR https://c.tile.openstreetmap.org/${z}/${x}/${y}.png
Wikimedia Maps https://maps.wikimedia.org/osm-intl/${z}/${x}/${y}.png
OpenCycleMap http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png OR http://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png
Humanitarian map style http://a.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png OR http://b.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png
OSM France http://a.tile.openstreetmap.fr/osmfr/${z}/${x}/${y}.png OR http://b.tile.openstreetmap.fr/osmfr/${z}/${x}/${y}.png OR http://c.tile.openstreetmap.fr/osmfr/${z}/${x}/${y}.png
OpenSkiMap http://tiles.skimap.org/openskimap/${z}/${x}/${y}.png
OpenSeaMap http://tiles.openseamap.org/seamark/${z}/${x}/${y}.png
waymarkedtrails https://tile.waymarkedtrails.org/hiking/${z}/${x}/${y}.png
Cycling routes https://tile.waymarkedtrails.org/cycling/${z}/${x}/${y}.png
Hike & Bike http://toolserver.org/tiles/hikebike/${z}/${x}/${y}.png
Hillshading http://c.tiles.wmflabs.org/hillshading/${z}/${x}/${y}.png
OSM B&W https://tiles.wmflabs.org/bw-mapnik/${z}/${x}/${y}.png or https://a.tiles.wmflabs.org/bw-mapnik/${z}/${x}/${y}.png OR https://b.tiles.wmflabs.org/bw-mapnik/${z}/${x}/${y}.png OR https://c.tiles.wmflabs.org/bw-mapnik/${z}/${x}/${y}.png
OSM no labels https://tiles.wmflabs.org/osm-no-labels/${z}/${x}/${y}.png or https://a.tiles.wmflabs.org/osm-no-labels/${z}/${x}/${y}.png OR https://b.tiles.wmflabs.org/osm-no-labels/${z}/${x}/${y}.png OR https://c.tiles.wmflabs.org/osm-no-labels/${z}/${x}/${y}.png
Stamen Toner http://a.tile.stamen.com/toner/${z}/${x}/${y}.png
Stamen Watercolor http://c.tile.stamen.com/watercolor/${z}/${x}/${y}.jpg
Transport Map http://a.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png OR http://b.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png
Thunderforest Landscape http://a.tile.thunderforest.com/landscape/${z}/${x}/${y}.png OR http://b.tile.thunderforest.com/landscape/${z}/${x}/${y}.png OR http://c.tile.thunderforest.com/landscape/${z}/${x}/${y}.png
Thunderforest Outdoors http://a.tile.thunderforest.com/outdoors/${z}/${x}/${y}.png OR http://b.tile.thunderforest.com/outdoors/${z}/${x}/${y}.png OR http://c.tile.thunderforest.com/outdoors/${z}/${x}/${y}.png
pnvkarte http://toolserver.org/~cmarqu/hill/${z}/${x}/${y}.png
OpenPtMap http://www.openptmap.org/tiles/${z}/${x}/${y}.png
CartoÿLight (“Positron”) https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png
CartoÿDark (“Dark Matter”) https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png
OpenRailwayMap http://a.tiles.openrailwaymap.org/standard/${z}/${x}/${y}.png OR http://b.tiles.openrailwaymap.org/standard/${z}/${x}/${y}.png OR http://c.tiles.openrailwaymap.org/standard/${z}/${x}/${y}.png

Here is a list so that you can copy and paste them directly 🙂

Dragons8mycat

Using OpenStreetMap Basemaps with QGIS 3.0” Comments

  1. Hi,
    I can’t display “CartoÿLight (“Positron”)”.
    Do you have any solutions to use it ?

    Thanks you !

    Laure

  2. Hi,
    It was working when I posted it, but checking it today, I can see it doesn’t work.
    I tried a few things to get it working again and nothing really nudged it into life BUT I DID find this clever script from Klas Karlsson here: https://raw.githubusercontent.com/klakar/QGIS_resources/master/collections/Geosupportsystem/python/qgis_basemaps.py
    Open QGIS 3, find your python console (normally 3rd row down to the right), open it and then copy & paste this script in…..when you refresh your catalog/browser pane, all the connections will be in there and working!!
    No more need to enter all the info one by one!
    Dragons8mycat

    • Andi

      Now it works. Thank you 🙂

  3. The tiles layer loads fine however the text renders too small for me to see it! Any idea why that might be??

    • Colin

      I’ve done some further testing. It appears that QGIS 3.0 does not correctly render base maps like OSM on High DPI (3200×1900) monitors…

    • Hi Colin,
      I’m currently looking into this, it might be an issue with high resolution or large displays. Where the data is served as tiles they normally scale well for both mobile and desktop screens do you have any screenshots or info on the screen and resolution you are using?

  4. Thanks so much! Really useful!

  5. Hi Colin, having looked into this further, I can confirm it is an issue with the high resolution, this is due to the high number of pixels. As far as I can see, this is a known issue which OSM are looking at but in the meanwhile, unless you specifically require vectortiles, you could use the WMS or raw data.

  6. Hi Nicholas,
    Thanks for your replay.
    I’m currently using a Lenovo Yoga 900 with 3200×1900 resolution.
    I can send you screen shots. If you email me then I’ll send them through.
    I’m looking at other work-arounds but we use QGIS in a production environment so we are limited by our IT department to a standard install. It has been suggest to build our own server and use vector tiles but building our own map server isn’t feasible. -_-

  7. Sir, I’m trying to load Tamil Nadu map in qgis 3
    i loaded it using xyz tiles using in-built openstreetmap plugin after clicking that my server is not able to load the tile.
    It is showing like getting tiles for long time and atlast it is displaying like “A network disconnected any data trying to load is incomplete” error.
    Help me with this sir!

  8. Thanks, Nicholas!

  9. I installed QGis 3.0.1-Girona on April 6th and it looks like there’s an OpenStreetMap item (with URL “http://a.tile.openstreetmap.org/{z}/{x}/{y}.png”) in the XYZ Tiles section added by default.

  10. […] is an article on xyHt published about how different OpenStreetMap tiles can easily be integrated into QGIS […]

  11. […] OSM und Place Search für 3.0 […]

  12. Thanks for this useful guide. I prepared map and in the layout it shows all city and country names but in the exported image the country name doesn’t appear. The city and place names are too small to be visible. Is there any adjustment of city/place name size possible?

  13. Hey, Thanks for the valuable guidance- Does anyone know how to change the language of OSM maps [street/road/mountain etc. names] in QGIS 3.0.2 instead of having the country language e.g. all in english? I found the QuickMapServices plugin as an option..but in vain! Anything to add to this problem?

    Thank you in advance,

    El

Leave a Reply

Your email address will not be published. Required fields are marked *