7

I need to fill a hole in a multi-polygon layer on QGIS 2.0. I've set the snapping option for the layer as follows :

  • mode: to vertex and segment
  • tolerance 4 pixels
  • avoid intersection "enabled"
  • topological editing "enabled"

When I try to edit a rough shape around the hole and confirm it right clicking, the system told me "The feature cannot be added because its geometry collapsed due to intersection avoidance"

enter image description here


Update:

I have a multipolygon file with a hole. I'm not able to fill the hole because if I manually edit it the system tells me that it is impossible to add it because the geometry is collapsed due to intersection avoidance. If I try to use the specifc tool it tells me that it's impossible due to the snapping settings.

These are the images:

specific tool

error message about snapping setting

snapping setting

enter image description here enter image description here

4

You're using the wrong tool for filling the hole: You're using the "Delete Ring" tool, but you should be using "Add Feature".

"Delete Ring" is used for deleting an interior ring of a single polygon feature (like the hole in a donut polygon). However, all your features are simple polygons consisting of only an exterior ring, so when you try to draw a large polygon to capture the empty space between your features, you get the "Could not snap segment" error message, as the tool can't find an interior ring to delete where you clicked.

In your case, "filling a hole" actually means "adding a feature that covers the extent not covered by any of the other features in the layer". To do that, you only need to set "Avoid intersections" in the Snapping options (the snapping itself doesn't have to be activated, and neither does the topological editing), and then create a new feature by generously drawing a polygon around the empty space (i.e. around the hole).

  • +1 This is the correct solution now we see the screen shots. The OP does not have a 'hole' in the conventional sense but merely wants to fill space enclosed by polygons. – MappaGnosis Oct 3 '13 at 7:42
  • ok, I've tried your method but now the system told me that the feature can't be added due to intersection avoidance, I've tried to disable in the snapping options the snap to to intersection (hope it's the right translation from italian) and if I edit and add a rough polygon now the system told me about an error in editing, the open me the attribute widows for editing the ID and the Others, but when I confirm the polygon doesn't fill the right geometry see the new images – Simone Demelas Oct 7 '13 at 8:13
  • @SimoneDemelas: Could you provide some test data so we can reproduce the error? – Jake Oct 7 '13 at 8:14
  • @jake sure just added to my dropbox dropbox.com/s/r2f6vpqjtawkc0w/Test.zip – Simone Demelas Oct 7 '13 at 8:30
  • @SimoneDemelas: Thanks for the data. The problems stem from the fact that you have topology errors in your data: There are a lot of partially overlapping polygons, and the "avoid intersections" tool can't work with that. You can see the overlapping polygons by selecting "Burn" in the "Feature blending mode" in the Layer properties. You'll need to clean the data first before you can fill the holes. – Jake Oct 7 '13 at 8:49
2

EDIT
This solution is correct for removing an interior ring (conventionally known as a 'hole'). However, until we saw the OP's screenshots, the situation was not clear. The OP does not have an interior ring, so Jake's solution is the correct one in that use-case. I'll leave this answer here in case future readers have the same confusion over enclosed space vs. interior rings as did the OP.

The simplest approach is to use the Advanced Digitizing Tools plugin. This has a tool specifically to remove holes in polygons (and another to add them!).

Use the 'Delete ring' tool. Set the layer to be editable (red x's appear at the vertices). Select the Delete ring tool and click on a vertex in the ring you want to delete. The ring disappears.

enter image description here

  • I've triend the "erase hole" (don't know the excat translation in english) but it tells me the because I've setted a tolerance it's impossible to use it and i don't know how to set the snapping option for this @MappaGnosis – Simone Demelas Oct 1 '13 at 14:49
  • I don't think we can be talking about the same tool. No snapping option is required for this. I tested this by setting the 'Avoid intersection' options and the snapping tolerance and it appears to make no difference to the removal of a ring, which works perfectly every time for me (QGIS 2.0) – MappaGnosis Oct 1 '13 at 15:10
  • added advanced digitizing image for clarity with 'Delete Ring' selected – Mapperz Oct 1 '13 at 15:29
  • 1
    @MappaGnosis: Judging from the screenshots and the error message, Simone doesn't have interior rings in his polygons (for which "Delete Ring" would be appropriate), but simply empty space between several simple polygons. – Jake Oct 2 '13 at 20:19
  • 1
    @Jake: Yes, I agree. The original post lacked the screenshots and the description of a 'hole' suggested an interior ring. This explains why I couldn't reproduce the error. I have left my post as it provides a solution to filling an interior ring (the question as originally asked) but edited it to point readers to your answer in case future readers need to understand the difference between an interior ring and enclosed space. – MappaGnosis Oct 3 '13 at 7:41
0

how about creating a seperate layer and creating a polygon in that new layer which, using snap, manually digitize the area.

the use data management tools to merge the layers to one new layer in a seperate location. using "merge shapefiles to one".

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.