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 then add it to the map. This recipe builds on the previous labeling recipe:
- First, to save space, we'll specify the path to the shapefile:
src = "/qgis_data/ms/MSCities_Geo_Pts.shp"
- Next, we'll load the...