1

When retrieving features from a layer with PyQGIS by sth. like

feat = [f for f in my_lyr.getFeatures('"road_name" = \'myroad\'')]

the resulting feat list is empty in cases where a filter is applied that does not cover 'my_road'.

Is there a way or a recommended workaroud to make getFeatures() ignore an existing filter? Perhaps creating a memory layer with all features from the original layer and do the request on this memory layer?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.