Using null symbols

Null symbols are a tool that allow you to have a layer without any symbology. Layers without symbology can be useful when you don't need to see a layer but need to interact with it in other ways, such as querying or specialized labeling. For example, if you have an imagery basemap, you may want to have labels on the map but no features. In this recipe, we'll load a point layer and label it, but use null symbology.

Getting ready

Download the zipped shapefile from https://github.com/GeospatialPython/Learn/raw/master/MSCities_Geo_Pts.zip.

Extract the shapefile to a directory named ms in your qgis_data directory.

How to do it...

We will load the layer, set the renderer to the null symbol renderer, set up our labeling configuration, and ...

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.