Bug report #9474
New vertices added to polygons break shape file topology
|Affected QGIS version:||2.0.1||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||worksforme|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||18066|
Consider I have a vector layer with a polygon in it.
Wanting to modify the shape of the polygon I decide to add a new vertex [N] between two existing vertices [A] and [B].
So I proceed:
- Switch edit mode on on the polygon vector layer
- Activate the Node Tool
- Double click near the edge connecting [A] and [B]; a new node [N] is added
- I move node [N] to a new position
The GUI reflects the changes as expected.
Now I save the layer as SHP file. I reload it in QGIS, the changes are all there.
The shape file still seems to remember the original [A]->[B] connection while also has the new [A]->[N]->[B] one!
Having the shape file loaded in various viewers/editors the inconsistency gets highlighted:
While QGis renders only the modified path [A]->[N]->[B], OpenJUMP shows only the old path [A]->[B], and TileMill -- with some semitransparency enabled -- shows them both.
#3 Updated by Attila Szász almost 7 years ago
- File bla.zip added
Hi Martin,Please see the attachment:
- bla_start.shp is the shape before modification
- bla_end.shp is the shape after modification
There's also a QGIS project file included for your convenience, bla.qgs having as a vector layer bla.shp which is identical with the modified shape, bla_end.shp.
I hope that all makes sense.
Let me know if you need any further support.
Thanks for your time.
#4 Updated by Martin Dobias almost 7 years ago
I fail to see what is actually wrong there - OpenJUMP and QGIS seem to render the layers in the same way.
Maybe your issue is the fact that there is one duplicate node in the polygon? OpenJUMP seem to handle the two nodes at one place just as one node compared to QGIS (which also highlights the duplicate node with a green X marker when node tool is active). The duplicate node is present in all of the three attached layers (bla, bla_start, bla_end).
If you mean something else, maybe try to explain that with some screenshots...
#5 Updated by Attila Szász almost 7 years ago
Thanks for looking into this;
Indeed my sample file doesn't seem to reproduce the problem. I apologise for that, I wasn't aware that it might work.
But I found the original shapefile I was working with, please find it attached.
It contains an additional edit that just I created following the steps I outlined in my original description: the new node is the one that is supposed to show a spike.
I also attach the screenshots in the three editors; you see the results are different.
You could try to add a new node just as I did, I hope it is straightforward to debug that way.