O'Reilly logo

QGIS Python Programming Cookbook by Joel Lawhead

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

Rendering map layers based on rules

Rendering rules provide a powerful way to control how and when a layer is displayed relative to other layers or to the properties of the layer itself. Using a rule-based renderer, this recipe demonstrates how to color code a layer based on an attribute.

Getting ready

You will need to download a zipped shapefile from https://geospatialpython.googlecode.com/svn/ms_rails_mstm.zip.

Unzip it and place it in the directory named ms in your qgis_data directory.

In this same directory, download and unzip the following shapefile:

https://geospatialpython.googlecode.com/files/Mississippi.zip

Finally, add this shapefile to the directory as well:

https://geospatialpython.googlecode.com/svn/jackson.zip

How to do it...

We will ...

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