Skip to content

Instantly share code, notes, and snippets.

@NathanW2
Created January 2, 2013 13:54
Show Gist options
  • Save NathanW2/4434735 to your computer and use it in GitHub Desktop.
Save NathanW2/4434735 to your computer and use it in GitHub Desktop.
def where(layer, expression):
for f in layer:
if expression.evaluate(f).toBool():
yield f
exp = QgsExpressin('"Col" = 99')
exp.prepare(layer.fields())
items = where(layer, exp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment