[Qgis-developer] Empty selectedFeatures list

Matthias Kuhn matthias at opengis.ch
Tue Aug 11 23:31:00 PDT 2015


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
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150812/6f962c33/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150812/6f962c33/attachment.pgp>


More information about the Qgis-developer mailing list