Bug report #9569
Unexpected result in topological editing when snapping to the line element currently being edited
|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|
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.
#1 Updated by Giovanni Manghi over 7 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 7 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.
#6 Updated by Leyan Ouyang over 7 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?
#10 Updated by Giovanni Manghi over 2 years ago
- Resolution set to end of life
- Status changed from Reopened to Closed
End of life notice: QGIS 2.18 LTR