Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a shapefile that consists of a single polygon. I have gaps within the polygon that needs to be eliminated, but only the ones that are less than 200m2.

I tried different ways but none of them work, I need to run this process as a batch process.

Any ideas?

share|improve this question
up vote 4 down vote accepted

1) create polygons where you have a hole. This can be done with the "difference" tool (just manually draw a large polygon in another layer, or do it with the buffer tool).

2) select the polygons which are less than 200m² and merge those with your original shapefile (you can use the union tool).

3) use the dissolve tool to revert to a single polygon

share|improve this answer
Thanks for the answer, I forgot to mention that i need to run this as a batch process, so during the batch I cannot select the polygons with area less than 200m2. Any other idea? – Aram Aug 14 '14 at 10:18
you can do a selection during the batch. e.g. with sextante.runalg("qgis:selectbyattribute","yourshp","AREA",4,200) – radouxju Aug 14 '14 at 11:37

Googling a bit I came to know this "ringer" experimental plugin for qgis, which seems to be good for your task. If this works (I did not test it), this would let you convert your holes into polygons. Then you would create a new field in the attribute table of the new polygons and calculate their area (with the field calculator). Then you would merge the hole polygons with your original polygon, selecting only those holes which are larger than 200m2. Hope this helps.

share|improve this answer
I should mention that I use qgis 2.4 and it does not work here since it has been written for another version (not soecified in the page). – umbe1987 Aug 14 '14 at 9:41
Thanks for the answer, I will have a look tomorrow on that plugin, but as far as undertand, i will need to select the polygons, and i didn't mention, I just changed the question, I need to run this in a bach run, I have thousands of layers to clean. Any Idea? regards – Aram Aug 14 '14 at 10:20

1) Polygons to lines

2) Lines to polygons

3) Dissolve

4) Select polygons from point 2) < 200 m2

5) Difference polygons from point 3) with polygons from point 4)

share|improve this answer

Your Answer


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.