QGIS 2.8+: How can layer.selectedFeatures() return an empty list while layer.selected

المشرف العام

Administrator
طاقم الإدارة
I noticed some changes since qgis 2.8 but can't find any information about it. Let's say I have a very simple point layer loaded in QGIS, from a spatialite table. From this layer I select some points and want to count how many points I've got in my selection using a few pyqgis lines. Very simple:

layer = qgis.utils.iface.activeLayer() nbrSelected=layer.selectedFeatureCount() selection01 = layer.selectedFeatures() What I've noticed is that if I select more than 999 features, nbrSelected still returns the correct number of points, but

len(selection01)

returns 0... the list is empty.

This wasn't happenning with QGIS 2.6 (I just checked again), but only on 2.8 and 2.10.

I tried on 2 different computers, with the same result.

Is there another way of browsing more than 1000 selected features? I also tried with the processing (processing.features(layer)) but it acts as if my selection was empty as well (i.e. returns the complete content of my layer, not just the selection)

thanks!

C.M.



أكثر...
 
أعلى