I am looking for an example of how to use the QgsRuleBasedRendererV2 to filter features of a layer based on an attribute value (0 or 1). Has anyone done this in Python or C++?
QGIS – Implement Rule Based Rendering in QGIS Effectively
cfilterqgisrule-based
Best Answer
This is an example of Python Code:
I tested it with this line vector layer ('expression' in field 'type'):
After run the code in the Python Console of QGIS (line2 as Active Layer):