I am trying to implement this solution (How to merge single polygons to multi part polygons by maximum distances?), but when I create a buffer around my polygons, those with holes are ignored. I tried to Delete Holes using the processing tool. It does fill the "real" holes but these features:

enter image description here

are not filled in. Polygons with these are also ignored when I try to buffer them...

If I try to fix them manually, I get this:

enter image description here

Also, these polygons were created from a raster using polygonize. How do I go about being able to create a buffer around such polygons?

marked as duplicate by ahmadhanb, Community Mar 7 '17 at 12:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Interesting problem! Unless that bottom-left vertex of that 'hole' is actually shared, it's probably not considered a hole as it is not closed. So I doubt the Delete holes or Fill holes tools will work. I would probably try snapping those vertices either manually or (if you have many features like this) use the GRASS tool v.clean with the snap function while setting a low-enough threshold so that other vertices won't get affected. And then try filling the hole. – Joseph Feb 16 '17 at 15:19
  • 1
    if that does touch then it's invalid so it is probably dropped by the buffer – Ian Turton Feb 16 '17 at 15:22
  • 1
    In the GEOS rules even if it does touch, it is not a hole. A polygon can touch itself on one point. This is different to ArcGIS rules of geometry validity: workshops.boundlessgeo.com/postgis-intro/… – HeikkiVesanto Feb 16 '17 at 17:12
  • The name for this is inversion gis.stackexchange.com/questions/137380/… – Vince Feb 17 '17 at 3:26
  • The problem is solved here : gis.stackexchange.com/questions/230736/… – Janita Mar 6 '17 at 9:35

I'm assuming the red is the polygon and the grey is "space". If that's the case and it is the single grey square "hole" that you are trying to remove then I don't think that it's a hole. Because of its location right next to the edge of the polygon, I would think that is just where the polygon pinches on itself.[polygon pinching and a hole in a polygon.]

In my scarily crude image I would assume your polygons are like the image on the left. I think you are going to have to go through each polygon and remove the nodes creating those pinched areas and then you'll find the buffer tool to work properly.

  • I tried "opening" the pinch and created a hole, which I can easily fix. But I have hundreds of these features so it's not feasible for me to go and fix them all. I should have mentionned that these polygons were created using polygonize from a raster image. Also, I have no problems with having hole or inversions in them, my main issues is that I can't buffer them. – JSlauzon Feb 17 '17 at 18:09
  • The buffer tool won't work because this "pinch" is creating an invalid geometry. I'm not completely clued in on GRASS but Joseph's comment is your best chance to cleaning the entire layer – Knightshound Feb 18 '17 at 11:54

As mentionned by @Janita, the answer is here: Fixed buffers and interior buffers are not working for a polygon that contains a hole

Works perfectly

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