Bug report #9474

New vertices added to polygons break shape file topology

Added by Attila Szász almost 11 years ago. Updated over 7 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Vectors
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

Description

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:

  1. Switch edit mode on on the polygon vector layer
  2. Activate the Node Tool
  3. Double click near the edge connecting [A] and [B]; a new node [N] is added
  4. 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.

PROBLEM:
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.

bla.zip (4.58 KB) Attila Szász, 2014-02-13 03:17 PM

grc1_x.zip - Shapefile (88.3 KB) Attila Szász, 2014-02-15 10:05 AM

Screenshots.zip - Renderings in QGIS, OpenJUMP and TileMill (848 KB) Attila Szász, 2014-02-15 10:05 AM

History

#1 Updated by Martin Dobias almost 11 years ago

Please attach your shapefile.

#2 Updated by Giovanni Manghi almost 11 years ago

  • Status changed from Open to Feedback

#3 Updated by Attila Szász almost 11 years ago

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 11 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 11 years ago

Hi Martin,

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.
Thank you.

#6 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Feedback to Open
  • Operating System deleted (Linux)

#7 Updated by Giovanni Manghi over 7 years ago

  • Resolution set to worksforme
  • Status changed from Open to Closed

This is very similar to several other reports filed in the "recent" past. This kind of issues should all be hopefully solved using a recent release of QGIS. Please reopen if necessary.

Also available in: Atom PDF