Skip to content

Instantly share code, notes, and snippets.

@NathanW2
Created March 31, 2015 12:43
Show Gist options
  • Save NathanW2/e1c4a0ee062f4f2dacc7 to your computer and use it in GitHub Desktop.
Save NathanW2/e1c4a0ee062f4f2dacc7 to your computer and use it in GitHub Desktop.
sym = QgsLineSymbolV2.createSimple({})
r = QgsRuleBasedRendererV2(sym)
sym2 = QgsLineSymbolV2.createSimple({})
exp = "sewer_type = 'Pipe'"
rule = QgsRuleBasedRendererV2.Rule(sym2, filterExp=exp)
r.rootRule().appendChild(rule)
iface.activeLayer().setRendererV2(r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment