Hi Anita,

I can imagine it is related to sending huge request like "fid=1 or fid=2
or fid=3 or fid=4..." and spatialite does not like it... I will try if
changing it to "fid in (1,2,3,4...)" makes it any better.

Anyway, please open a ticket for it, this definitely looks like a bug.

Best,
Matthias

On 08/11/2015 09:51 PM, Anita Graser wrote:
> 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
>
>
>
> _______________________________________________
> Qgis-developer mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/qgis-developer

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to