0

I'm using the difference tool in QGIS to remove a bunch of areas from a polygon representing a state. Problem is, these areas don't fit together perfectly, and the result looks very messy.

How can I clean this up so that only the larger areas are displayed, and get rid of all the areas that are so thin they look like lines?

Original polygon:

enter image description here

Polygon after running difference tool:

enter image description here

7
  • 1
  • 2
    What does the other layer that you are differencing represent? Can you clean it up before differencing? Commented Jul 19 at 1:50
  • @ Tom Brennan They represent multiple different things such as mineral titles and national parks. I need a way to clean it up automatically because it's updated daily. I can't do it manually
    – user240982
    Commented Jul 19 at 5:45
  • 1
    Have you tried the gridsize parameter of the difference tool as explained here? gis.stackexchange.com/questions/480057/…
    – Pieter
    Commented Jul 19 at 5:59
  • @ Michael Stimson. Thank you. This was not exactly what I needed, but it gave me the idea of how to solve the issue. ran the boundary tool on the difference layer, then buffered the output by the width of the slivers, making sure to make the ends square and miter joins to retain the original shape. I then ran the difference tool on the original difference layer using the buffered boundaries as the overlay. I then rebuffered the output layer back to the original extent
    – user240982
    Commented Jul 19 at 6:38

1 Answer 1

1

After reading the replies I was able to adapt those suggestions to this situation

Step 1: Run boundary tool on original difference layer

Step 2: Run buffer tool on boundary layer, with a distance slightly exceeding the width of the slivers I am trying to remove. Being sure to select square endcaps and miter join style to retain original shape.

Step 3: Run difference tool with buffer output as the overlay and original difference layer as input.

Buffer the new difference layer with identical parameters to how the boundary layer was buffered. This restores the polygons to their original extent.

Original difference layer:

enter image description here

After completing these steps:

enter image description here

1
  • Accept your answer with the checkbox
    – Bera
    Commented Jul 28 at 8:12

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.