Hi devs,

maybe the question can sound trivial but I didn't find a solution.

Simply I would like to iterate only on selected features of a vector
layer features with an expression.

I know that the QgsFeatureRequest can be used with `setFilterExpression`
and `setFilterFids`.

Is it possible to combine them, so merging the following example in an
unique request?

exp = ''' "PH" > 7 '''
request = QgsFeatureRequest().setFilterExpression(exp)
l = [i.id() for i in vl.selectedFeatures()]
request = QgsFeatureRequest().setFilterFids(l)

for i in vl.getFeatures(request):
    ......


Thanks for all the suggestions!

Cheers

Matteo
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to