[Qgis-developer] setFilterExpression() does not works?
alexander.bruy at gmail.com
Wed Jul 23 07:16:39 PDT 2014
seems expression filtering of features does not works when used from Python.
Here is my test code for Python console:
layer = iface.mapCanvas().currentLayer()
expr = '"dt" = \'2014-07-05\' AND abs("y" - 3.0) <= 0.000001'
request = QgsFeatureRequest().setFilterExpression(expr)
for f in layer.getFeatures(request):
This code find no matches in attached shapefile when executed from Python
console, but when I try to use same expression in "Select by Expression" tool it
selects one feature.
Maybe I miss something? Should I open a ticket?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 737 bytes
Desc: not available
More information about the Qgis-developer