Bug report #9462

layer.getFeatures on return the first feature

Added by Arnaud Morvan about 10 years ago. Updated about 10 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:-
Affected QGIS version:2.0.1 Regression?:No
Operating System:Ubuntu Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18054

Description

When I make iterator, I get only one feature while layer.featureCount() return 28

total = layer.featureCount()
request = QgsFeatureRequest()
iterator = layer.getFeatures(request)
for feature in iterator:

I use spatialite layer with QGIS 2.0.1-Dufour from apt-get on ubuntu 13.04

History

#1 Updated by Matthias Kuhn about 10 years ago

  • Status changed from Open to Feedback

Hi Arnaud,

Can you try to update the statistics for this layer? (Go to the "Add Spatialite Layer" dialog, connect to your DB and click "Update Statistics")

#2 Updated by Arnaud Morvan about 10 years ago

I got an error : Error while updating internal statistics

#3 Updated by Arnaud Morvan about 10 years ago

In iterator loop, I call layer.dataProvider().changeAttributeValues({ feature.id() : attrs })
when I comment this line the iterator work correctly

#4 Updated by Arnaud Morvan about 10 years ago

  • Status changed from Feedback to Closed

in version 2.0.1 vector providers do not allow multiples iterators

[[https://issues.qgis.org/projects/quantum-gis/repository/revisions/3747c2bb020625871d6a0352f1a968657d443bf6]]

Also available in: Atom PDF