english

Easily add custom tilemap layers in QGIS

QGIS is growing fast and is considered by many as a valid (or even superior) alternative to ESRI’s ArcGIS. In one of my previous posts I described how to use GDAL xml-files to simply add baselayers of different sources (WMS/TMS). With QGIS 2.18 Las Palmas, a new feature has been introduced that natively allows to add tilemap layers.

Step-by-step guide

To show you how simple it is to add tilemap layers to QGIS I will use the example of OpenTopoMap (a layer that was asked for in the comments of my previous post).

1. Find your tilemap URL

Normally this URL contains at least placeholder for x, y and z. In the example of opentopomap, a quick google search guides me to the OpenTopoMap page on the OpenStreetmap wiki.
The last paragraph shows how OpenTopoMap can be used:

{a|b|c}.tile.opentopomap.org/{z}/{x}/{y}.png

Within this URL, the highlighted parts have the following function:
{a|b|c} specifies that one of three servers shall be used. (either a.tile.opentopomap.org, b.tile.opentopomap.org or c.tile.opentopomap.org)
{z} sets the zoom-level for which the tile is requested. The more we zoom in, the more tiles we get.
{x}/{y} indicate which tile is loaded. Values normally refer to the tile number form an origin point.

2. Activate the browser panel

Look for the browser panel in the QGIS interface. If not open yet, you can add it by going into the “view” menu > “panels” > “Browser panel”.

3. Add your service as a tilemap server to QGIS

In your browser panel scroll down and make a right click on “Tile Server (XYZ)”. A context menu will open that allows you to create a new connection.

Selecting this function will bring up a window that allows us to enter the previously found URL for our service.

You see in my example that I selected one of the three options for the server and added the “http://”-prefix to complete the URL.

4. Add the layer to your project

Now that you service appears in your list of tilemap server you can now double-click it to add the layer to your project.

Troubleshooting

Conclusion

What does that mean for you? From now on any time you stumble upon a reference to a URL that includes the {x}/{y}/{z} triplet, you can directly add this to your tilemap collection.

Do you have any favorite sources? Share them in the comments below…

Exit mobile version