New answers tagged


Solution 2 doesn't work because 'my_layer.getFeatures(request)' is a QgsFeatureIterator object. You have to create, for example, a memory layer with the features "into" this object. In my case, I used the next shapefile, with 8 features, for selecting the features with indexes 1, 5 and 7. The complete code is: layer = iface.activeLayer() request = ...

Top 50 recent answers are included