O'Reilly logo

Building Mapping Applications with QGIS by Erik Westra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with custom map layers

Instead of using a standard map layer with a data provider, features, symbols, and so on, you can implement your own custom map layer entirely in Python. Custom map layers are generally used to draw specific data that is too complicated to represent as vector format data, or to draw special visual features such as a grid or a watermark onto the map.

Custom map layers are implemented by subclassing the QgsPluginLayer class. The process is actually very simple, though you will need to translate between map and device coordinates so that the items you draw in your Python layer match up with the features drawn in the other layers within your canvas.

Note

Don't get confused by the name; you don't have to write a QGIS plugin ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required