Select the holes in a vector shapefile in QGIS

If you dont mind a two step process:

  1. Run "Delete Holes" from processing toolbox on your "PolygonWithHoles"
  2. Run "Difference" and use your "Cleaned" (Result from Delete Holes) as Input and your "PolygonWithHoles" as Overlay:

enter image description here

Result:

enter image description here


If you wish a one-step solution, you could also use "Geometry by Expression" with this expression:

difference(make_polygon(exterior_ring($geometry)),$geometry)

or a "virtual layer" with this query:

select difference(make_polygon(exterior_ring(geometry)),geometry) from PolygonWithHoles

Both will return a multipolygon of the holes.

Tags:

Vector

Qgis

Holes