Bug report #6097

Getting wrong attribute values from a feature in qgis

Added by Stig Henning Fredheim over 11 years ago. Updated almost 8 years ago.

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


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.

attributeValueBug.py Magnifier (1.32 KB) Stig Henning Fredheim, 2012-07-25 09:56 AM


#1 Updated by Paolo Cavallini about 11 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#2 Updated by Jürgen Fischer over 9 years ago

  • Target version changed from Version 2.0.0 to Future Release - Lower Priority

#3 Updated by Médéric RIBREUX almost 8 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 8 years ago

  • Resolution set to not reproducable
  • Status changed from Feedback to Closed

closing for the lack of feedback, please reopen if necessary.

Also available in: Atom PDF