[Qgis-developer] Empty selectedFeatures list

Anita Graser anitagraser at gmx.at
Tue Aug 11 12:51:52 PDT 2015


Hi,

This issue just appeared on gis.stackexchange:
http://gis.stackexchange.com/questions/157846/qgis-2-8-how-can-layer-selectedfeatures-return-an-empty-list-while-layer-sel


selectedFeatures() returns an empty list if lots of features are selected.

I tested with a Spatialite layer and QGIS shows "SQLite error: Expression
tree is too large (maximum depth 1000)" in the Spatialite log panel but
there is no other indication (i.e. error thrown) of anything going wrong.

Code to reproduce:

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.
Should I open a ticket? Or is there something I'm missing?

Thanks and best wishes,
Anita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150811/0c3ff485/attachment-0001.html>


More information about the Qgis-developer mailing list