Bug report #9569

Unexpected result in topological editing when snapping to the line element currently being edited

Added by Leyan Ouyang over 5 years ago. Updated 8 months ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Digitising
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:18152

Description

To reproduce the bug:

  • Enable the topological editing in the snapping options
  • Using the nodetool, move a vertex of a line element and snap to a segment of this same element.

Result expected: Moving the vertex and creating a new vertex to separate the segment at the new position
Result obtained: The vertex does not move, but three vertices appear at the same place in the segment.

If doing the same with polygons, only a single vertex is added, but the first vertex is still not moved.

History

#1 Updated by Giovanni Manghi over 5 years ago

  • Target version set to Version 2.2
  • Status changed from Open to Feedback

I'm on qgis master/ubuntu and it's weird because what I see is:

  • for lines I see what you describe for polygons
  • for polygons I see something similar to what you describe for lines, but instead of having 3 nodes created on the segment, for me are just 2

#2 Updated by Leyan Ouyang over 5 years ago

I made some more investigation: the number of nodes created is not linked to the type of layer, but to the number of layers added after the layer edited (and with snapping active). The issue is linked to the call to QgsVectorLayerEditUtils::insertSegmentVerticesForSnap before moving the selected vertices.

#3 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed/implemented

I cannot replicate anymore on the latest master, something has changed, for the better. Please reopen if I'm wrong.

#4 Updated by Leyan Ouyang over 5 years ago

  • Status changed from Closed to Reopened

Nothing changed from my side, I did not see any commit related to that either.

Could someone else confirm whether they can see the bug ?

#5 Updated by Giovanni Manghi over 5 years ago

Leyan Ouyang wrote:

Nothing changed from my side, I did not see any commit related to that either.

Could someone else confirm whether they can see the bug ?

are you using the latest master? on what platform? what revision are you testing?

#6 Updated by Leyan Ouyang over 5 years ago

I tried with revision 882dd0c pulled yesterday. I am on Linux (Archlinux), but I don't think it can be platform-specific.

From my understanding, the bug is linked to mapnodetool calling insertSegmentVerticesForSnap (the call is here , to this function ). The function insertSegmentVerticesForSnap will insert one vertex for each snapping result, but it seems this insertion will mess with the vertex indice when later moving the point which was manipulated.

To solve this, the vertex insertion could be done after the original vertex moving, so that it is not affected. Then the insertSegmentVerticesForSnap needs to be improved to avoid inserting several points at the same position.

Nothing was changed recently in these two functions, so I don't know how the bug could have disappeared. Now the result is correct for you?

#7 Updated by Giovanni Manghi over 5 years ago

  • Resolution deleted (fixed/implemented)
  • Target version changed from Version 2.2 to Version 2.4

Leyan Ouyang wrote:

Now the result is correct for you?

no you are right, I forgot an import detail when I tested the second time.

#8 Updated by Jürgen Fischer over 5 years ago

  • Target version changed from Version 2.4 to Future Release - High Priority

#9 Updated by Giovanni Manghi over 2 years ago

  • Regression? set to No
  • Easy fix? set to No

#10 Updated by Giovanni Manghi 8 months ago

  • Resolution set to end of life
  • Status changed from Reopened to Closed

Also available in: Atom PDF