Skip to main content
added 941 characters in body
Source Link
Babel
  • 80.4k
  • 15
  • 97
  • 245

A solution for many holes to fill at once. This algorithmic approach could be used with any software and could be fully automatized, here I show it for QGIS. See step-by-step screenshots below:

  1. Draw a new polygon covering all holes completelyCreate the layer's bounding box. Let's call this layer fillBounds.

  2. Run Menu Vector / Geoprocessing Tools / Difference, set fillBounds as Input layer and the original polygons as Overlay layer. This creates the layer Difference.

  3. Run menu Menu Vector / Geometry Tools / Multipart to singleparts.

  4. Delete the parts that fall outside the initial polygon (thouse touching the outer ring of the bounding box). Select them, using select by expression with the following expression, then delete the selected feature:

     touches ( @geometry, exterior_ring( geometry ( get_feature_by_id ('Bounds',1) ) ) ) 
  5. You're left with the holes only. Run Union to combine them with the initial polygon.

  6. Dissolve the Union layer to merge all features to one polygon.

Screenshot: Screenshots: 1,: original polygons in blue, fill polygon hashedwith holes in red: enter image description here

Screenshotblue; Bounding box hached in red; 2/3: after running difference, showingonly the result of step 3, hashed in orange. Theholes and the part outside the holes isinitial polygon remains; the latter can be selected as those features that touch the outer ring of the bounding box (yellowred) and can be deleted. You; 4) after deleting, you remain with the polyons that fillinitial polygon + holes; 5) Running Union, the initial polygon plus the holes are on the same layer; 6) Dissolved layer with the holes filled: enter image description here

enter image description here

A solution for many holes to fill at once:

  1. Draw a new polygon covering all holes completely. Let's call this layer fill.

  2. Run Menu Vector / Geoprocessing Tools / Difference, set fill as Input layer and the original polygons as Overlay layer.

  3. Run menu Menu Vector / Geometry Tools / Multipart to singleparts.

  4. Delete the parts that fall outside the holes.

Screenshot 1, original polygons in blue, fill polygon hashed in red: enter image description here

Screenshot 2, showing the result of step 3, hashed in orange. The part outside the holes is selected (yellow) and can be deleted. You remain with the polyons that fill the holes: enter image description here

A solution for many holes to fill at once. This algorithmic approach could be used with any software and could be fully automatized, here I show it for QGIS. See step-by-step screenshots below:

  1. Create the layer's bounding box. Let's call this layer Bounds.

  2. Run Menu Vector / Geoprocessing Tools / Difference, set Bounds as Input layer and the original polygons as Overlay layer. This creates the layer Difference.

  3. Run menu Menu Vector / Geometry Tools / Multipart to singleparts.

  4. Delete the parts that fall outside the initial polygon (thouse touching the outer ring of the bounding box). Select them, using select by expression with the following expression, then delete the selected feature:

     touches ( @geometry, exterior_ring( geometry ( get_feature_by_id ('Bounds',1) ) ) ) 
  5. You're left with the holes only. Run Union to combine them with the initial polygon.

  6. Dissolve the Union layer to merge all features to one polygon.

Screenshot: Screenshots: 1: original polygon with holes in blue; Bounding box hached in red; 2/3: after running difference, only the holes and the part outside the initial polygon remains; the latter can be selected as those features that touch the outer ring of the bounding box (red); 4) after deleting, you remain with the initial polygon + holes; 5) Running Union, the initial polygon plus the holes are on the same layer; 6) Dissolved layer with the holes filled:

enter image description here

deleted 43 characters in body
Source Link
Babel
  • 80.4k
  • 15
  • 97
  • 245

If you haveA solution for many holes you want to fill, you can achieve this easily this way at once:

  1. Draw a new, simple polygon that coverscovering all holes completely. Let's call this layer fill.

  2. Run Menu Vector / Geoprocessing Tools / Difference, set fill as input layerInput layer and the original polygons as overlay layerOverlay layer.

  3. Run menu Menu Vector / Geometry Tools / Multipart to singleparts.

  4. Delete the parts that fall outside the holes.

Screenshot 1, original polygons in blue, fill polygon hashed in red: enter image description here

Screenshot 2, showing the result of step 3, hashed in orange. The part outside the holes is selected (yellow) and can be deleted. You remain with the polyons that fill the holes: enter image description here

If you have many holes you want to fill, you can achieve this easily this way:

  1. Draw a new, simple polygon that covers all holes completely. Let's call this layer fill.

  2. Run Menu Vector / Geoprocessing Tools / Difference, set fill as input layer and the original polygons as overlay layer.

  3. Run menu Menu Vector / Geometry Tools / Multipart to singleparts.

  4. Delete the parts that fall outside the holes.

Screenshot 1, original polygons in blue, fill polygon hashed in red: enter image description here

Screenshot 2, showing the result of step 3, hashed in orange. The part outside the holes is selected (yellow) and can be deleted. You remain with the polyons that fill the holes: enter image description here

A solution for many holes to fill at once:

  1. Draw a new polygon covering all holes completely. Let's call this layer fill.

  2. Run Menu Vector / Geoprocessing Tools / Difference, set fill as Input layer and the original polygons as Overlay layer.

  3. Run menu Menu Vector / Geometry Tools / Multipart to singleparts.

  4. Delete the parts that fall outside the holes.

Screenshot 1, original polygons in blue, fill polygon hashed in red: enter image description here

Screenshot 2, showing the result of step 3, hashed in orange. The part outside the holes is selected (yellow) and can be deleted. You remain with the polyons that fill the holes: enter image description here

added 430 characters in body
Source Link
Babel
  • 80.4k
  • 15
  • 97
  • 245

If you have many holes you want to fill, you can achieve this easily this way:

  1. Draw a new, simple polygon that covers all holes completely. Let's call this layer fill.

  2. Run Menu Vector / Geoprocessing Tools / Difference, set fill as input layer and the original polygons as overlay layer.

  3. Run menu Menu Vector / Geometry Tools / Multipart to singleparts.

  4. Delete the parts that fall outside the holes.

Screenshot 1, original polygons in blue, fill polygon hashed in red: enter image description here

Screenshot 2, showing the result of step 3, hashed in orange. The part outside the holes is selected (yellow) and can be deleted. You remain with the polyons that fill the holes: enter image description here

If you have many holes you want to fill, you can achieve this easily this way:

  1. Draw a new, simple polygon that covers all holes completely. Let's call this layer fill.

  2. Run Menu Vector / Geoprocessing Tools / Difference, set fill as input layer and the original polygons as overlay layer.

  3. Run menu Menu Vector / Geometry Tools / Multipart to singleparts.

  4. Delete the parts that fall outside the holes.

If you have many holes you want to fill, you can achieve this easily this way:

  1. Draw a new, simple polygon that covers all holes completely. Let's call this layer fill.

  2. Run Menu Vector / Geoprocessing Tools / Difference, set fill as input layer and the original polygons as overlay layer.

  3. Run menu Menu Vector / Geometry Tools / Multipart to singleparts.

  4. Delete the parts that fall outside the holes.

Screenshot 1, original polygons in blue, fill polygon hashed in red: enter image description here

Screenshot 2, showing the result of step 3, hashed in orange. The part outside the holes is selected (yellow) and can be deleted. You remain with the polyons that fill the holes: enter image description here

Source Link
Babel
  • 80.4k
  • 15
  • 97
  • 245
Loading