Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1103 closed bug (fixed)

split feature - Bug in copy attributes

Reported by: beltegeuse Owned by: beltegeuse
Priority: critical: causes crash or data corruption Milestone:
Component: Vectors Version: Trunk
Keywords: split, feature, attribute, copy Cc:
Must Fix for Release: Yes Platform: All
Platform Version: Awaiting user input: yes

Description

Hi all, I use QGIS for one month and i think it's a good soft but there is a problems with the split feature. Explain :

  1. You have a feature with attribute and id (ex : 3660)
  2. You split these feature so you have two features. (The original feature with id = 3660 and the new feature id = -1).
  3. You split the new feature (id = -1) so we have three features (id : [3660,-1,-2]).
  4. You split one once again the feature (id = -1) so you get a feature with the id is -4. You have 4 features.

=> And when your commit change, your feature (old id = -3) have no attribute.

ScreenShot :

Attachments (1)

SceenShot.png (26.0 KB ) - added by beltegeuse 16 years ago.
screenshot

Download all attachments as: .zip

Change History (4)

by beltegeuse, 16 years ago

Attachment: SceenShot.png added

screenshot

comment:1 by beltegeuse, 16 years ago

Owner: changed from nobody to beltegeuse
Status: newassigned

it's link with QgsGeometryMap. QgsGeometryMap bug when featureId is negative. To have a different issue :

In qgsvectorlayer.cpp : in splitfeature fucntion : remplace :

mChangedGeometries.insert(select_it->featureId(), *(select_it->geometry()));

by :

if(select_it->featureId()<0)
{
   
}
else
{
 mChangedGeometries.insert(select_it->featureId(), *(select_it->geometry()));
}

comment:2 by beltegeuse, 16 years ago

Resolution: fixed
Status: assignedclosed

comment:3 by (none), 15 years ago

Milestone: Version 1.0.0

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.