3

I have two polygons in QGIS that are within the same layer and I want to merge them so they are not in two different polygons, which means that the gap between them sould not exist. How do I do that?

enter image description here

  • You could physically move one polygon to the other by editing the shapefile and using the Move Feature(s) tool, then you could select both polygons and use the Merge Selected Features tool (from the Edit toolbar). – Joseph Dec 15 '15 at 16:21
  • Thanks for your answer! The trick is that I need the polygon from the left hand side to be exactly where it is located. – Adela-Ioana Moldovan Dec 15 '15 at 16:51
  • Is there a way to take the convex hull of both shapes with a very high tolerance - ie. snapping almost to each vertex then 'across' the gap? – DPSSpatial Dec 15 '15 at 16:55
  • Unfortunately I don't know how to do that. – Adela-Ioana Moldovan Dec 15 '15 at 16:57
3

If you don't know Python, try OpenJump GIS. It can do things not present in QGIS

1) the polygons

enter image description here

2) unions in the same layer

enter image description here

3) Convex Hull

enter image description here

3) Concave Hull

enter image description here

4) you can adjust parameters

enter image description here

But is is the best result that you will get without programming (how to join the polygons, nodes, vertices ?)

enter image description here

(one result with Shapely)

3

A quick way to get an acceptable result is the Expand-Shrink method, but for vectors

In this image we have the original shapes.

  • Step 1 is to create a dissolved buffer that will join the two features, with the buffer distance (x) being more or less the gap. (black line)
  • Step 2 is to create another buffer with a negative (-x) of the aforementioned value (blue line)

The result works well for strait segments, but adds some area to the polygons at corners. enter image description here

I'm sure there are additional steps one can take to refine the results.

2

Try concave hull plugin. It allows you to group features or build clusters before applying a concave hull. It's available from the plugin repo. Examples and some background on its git web page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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