3

I just ran into unexpected behavior while editing a polygon shapefile in QGIS 2.8.2.

Scenario:
A polygon:
enter image description here

Then I cut that polygon into two seperate poygons: enter image description here

Then I use the Node Tool to move a vertex: enter image description here

And that's my question. Why would this create a gap? This means that the Cut tool creates two edges, which is definitely not how it should be, as edges should always be shared, hence reducing the complexity of the dataset.

I have tried to select both vertices, but that does not work; only the one on top can be selected.

Is my only option to activate snapping and move both vertices individually or is there a tool or plugin that can do this?

0

2 Answers 2

3

Figured it out, and it had to do with my understanding of the shapefile format. I was not aware that each feature has their own seperate boundaries. I used to think that one edge can be shared by two adjacent polygons.

To have both lines/vertices move at the same time all you have to do is enable topological editing in the snapping options.

3
  • 1
    As you suspect, has to do with how data is stored. Shapefiles and geodatabases use individual, independent geometries. The older Esri Coverage format worked like you were thinking, as does GRASS I believe - nodes are stored and geometries are created from stored node lists. As you discovered, separate geometries requires topological editing (QGIS or ArcGIS). As someone who never really worked with coverages, I would have the exact opposite reaction as you (ie, expect two separate lines to be created and be surprised if I couldn't 'pull the shapes apart').
    – Chris W
    Jul 3, 2015 at 0:33
  • 1
    Related: gis.stackexchange.com/questions/113894
    – Chris W
    Jul 3, 2015 at 0:36
  • Thank you for the clarification and for the reference; that link is actually very interesting and helpful. I learned in some class that GIS data formats are so smart because they share edges, and it really took me this long to learn that this is not a universal truth, and very dependent on the format. It's been a very eye-opening week, and I think I need to shoot my teacher an email ;-) Jul 3, 2015 at 7:37
1

I don't think this is a bug as currently, you're selecting to move the vertex of the left polygon which is similar to reshaping it:

Left polygon

With the Node Tool, first select a node from the right polygon so that the Node tool knows which vertices belong to it. Then move the same vertex as before:

Right polygon

There shouldn't be a gap anymore, instead you would be overlapping the left polygon with the right polygon.

Hope this is somewhat clear... :)

3
  • 1
    @BritishSteel - Actually let me know if I have misunderstood your question and I will remove this post as I am now guessing you were looking to move the vertices so that both polygons would be affected?
    – Joseph
    Jul 1, 2015 at 10:23
  • 1
    Problem solved, see my answer. It had to do with my understanding of how shapefiles work internally. I was surprised that a tool like cut actually adds two coincident lines (one edge for each feature), instead of adding one line that is shared by both features. Using topological editing solves the issue; I had overlooked that option ;-) Jul 1, 2015 at 11:07
  • @BritishSteel - Awesome, glad you found the solution! Yes, I too thought that the line would be shared (would make life a lot easier!), I'll have to keep this in mind whenever I cut features :)
    – Joseph
    Jul 1, 2015 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.