Bug report #6097
Getting wrong attribute values from a feature in qgis
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Vectors | ||
Affected QGIS version: | 1.8.0 | Regression?: | No |
Operating System: | Windows | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | not reproducable |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 15443 |
Description
This scenario shows the bug:
I make two polylines features(in my example both consists of two points) with the add feature tool. Then I (with code) add some attribute values on the first feature, then changes the geometry of the second feature before I add values to the second values.
When I use layer.featureAtId() to get the second feature and then reads it, I get the values from the first feature.
But when using feat.geometry().asPolyline(), I get the correct geometry
I don't get this problem if I don't change the geometry or if I commit the two new polylines before doing the mentioned operations.
In the attribute table it is correct. If I use layer.nextFeature(feat) to iterate through all the features I get the right value.
There is a python script attached to show the bug. This code demands a little manual interaction to work. The comments says where the interaction is needed.
History
#1 Updated by Paolo Cavallini about 12 years ago
- Target version changed from Version 1.8.0 to Version 2.0.0
#2 Updated by Jürgen Fischer over 10 years ago
- Target version changed from Version 2.0.0 to Future Release - Lower Priority
#3 Updated by Médéric RIBREUX almost 9 years ago
- Status changed from Open to Feedback
Hello, bug triage...
I can't reproduce it on QGIS master (2.13).
Can you confirm this ?
#4 Updated by Giovanni Manghi almost 9 years ago
- Resolution set to not reproducable
- Status changed from Feedback to Closed
closing for the lack of feedback, please reopen if necessary.