Creating tiles from a QGIS map

This recipe creates Internet web map tiles from your QGIS map. What's interesting about this recipe is once the static map tiles are generated, you can serve them up from any web-accessible directory using JavaScript client-side in a browser without the need for a map server.

Getting ready

You will need to download the following zip-shape file from this URL:

https://github.com/GeospatialPython/Learn/raw/master/countries.zip

Unzip the file to a directory named shapes in your qgis_data directory.

You will also need to install the QMetaTiles plugin using QGIS Plugin Manager.

How to do it...

We will load our shapefile and randomly color each country. We'll then manipulate the QMetaTiles plugin using Python to generate map ...

Get QGIS Python Programming Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.