Creating a categorized vector layer symbol

A categorized vector layer symbol allows you to create distinct categories with colors and labels for unique features. This approach is typically used for datasets with a limited number of unique types of features. In this recipe, we'll categorize a vector layer into three different categories.

Getting ready

For this recipe, we'll use a land use shapefile, which you can download from https://github.com/GeospatialPython/Learn/raw/master/landuse_shp.zip.

Extract it to a directory named hancock in your qgis_data directory.

How to do it...

We will load the vector layer, create three categories of land use, and render them as categorized symbols. To do this, we need to perform the following steps:

  1. First, we need ...

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.