Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Does anyone know how I can extract the holes in a polygon layer as a separate layer in Quantum GIS? An example could be a country with a number of lakes cut out of the polygon - I need the lakes.

I have tried the Union-tool in ArcGIS, but I'm getting a lot of 000117-errors no matter what I do (Multipart to Singlepart, Project, changing the Environments and so on).

Thanks :)

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

This is fairly simple and you can do it all natively in QGIS (i.e.without exporting to PostGIS).

  1. Convert you polygon to lines (Vector->Geometry Tools->Polygon to lines)
  2. Convert the lines back into polygons (Vector->Geometry Tools->lines to polygons)
  3. Difference your new polygons against the original polygons

Step 2 is the key here. Step two creates a set of overlapping polygons, one of which represents your landmass with no holes and the others are your lakes. Step three kills the landmass polygon leaving just the lakes.

I vaguely remember a thread where somebody was asking how to de-doughnut polygons. You could use this same approach but instead of differencing your result with the original, simply dissolve the result, or do a spatial join and then select by attribute if dissolve is too crude... anyway, that's getting off-topic.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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