Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getFeatures() can't be run twice on an OSM file #27920

Closed
qgib opened this issue Oct 13, 2018 · 4 comments
Closed

getFeatures() can't be run twice on an OSM file #27920

qgib opened this issue Oct 13, 2018 · 4 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers Regression Something which used to work, but doesn't anymore

Comments

@qgib
Copy link
Contributor

qgib commented Oct 13, 2018

Author Name: Etienne Trimaille (@Gustry)
Original Redmine Issue: 20098
Affected QGIS version: 3.3(master)
Redmine category:data_provider/ogr
Assignee: Even Rouault


Since this commit f410b4a, the python iterator getFeatures() can't be run twice on an OSM file:

l = QgsVectorLayer('/tmp/request-jY9056.osm|layername=multipolygons', "test", "ogr")
print('first loop')
for f in l.getFeatures():
    print(f.id())

print('second loop')

for f in l.getFeatures():
    print(f.id())

print('end loops')

It gives:

exec(open('/home/etienne/quickosm.py'.encode('utf-8')).read())
first loop
65738329
65739173
65744728
65759782
second loop
end loops

It was working fine the commit before.

This breaks the QuickOSM plugin: 3liz/QuickOSM#125

Thanks


@qgib
Copy link
Contributor Author

qgib commented Oct 13, 2018

Author Name: Etienne Trimaille (@Gustry)


Using GDAL/OGR 2.2.3 on Ubuntu 18.04

@qgib
Copy link
Contributor Author

qgib commented Oct 13, 2018

Author Name: Even Rouault (@rouault)


  • assigned_to_id was configured as Even Rouault

@qgib
Copy link
Contributor Author

qgib commented Oct 14, 2018

Author Name: Even Rouault (@rouault)


#8184

@qgib
Copy link
Contributor Author

qgib commented Oct 15, 2018

Author Name: Even Rouault (@rouault)


Applied in changeset 906f802.


  • done_ratio was changed from 0 to 100
  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Oct 15, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers Regression Something which used to work, but doesn't anymore labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

1 participant