Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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 polygon Shapefile, which I need to generalize. How can I generalize the poligons and ensure that there are no topological errors like "slivers".

I already tried:

  1. Vector -> Geometry Tools -> polygones to lines
  2. Vector -> Geometry Tools -> simplfy geometries ... here I can already see on the screen, that I am producing overlaps and gaps nevertheless now I try
  3. Vector -> Geometry Tools -> lines to polgones

and here the program show an error and crashes

enter image description here

share|improve this question
Are there any news on this issue? – Oystein Nov 28 '13 at 9:11
unfortunately: no – Kurt Nov 30 '13 at 19:39
up vote 12 down vote accepted

GRASS is topology-aware. You can use v.generalize from the Processing toolbox to simplify polygons and if the input data is topologically correct so will the output.

enter image description here

share|improve this answer
using the windows-installer I am getting an error (missing dependency), when I try to run v.generalize. Do need to a special configue? – Kurt Dec 21 '14 at 19:36
@Kurt: The stand-alone installer? Not sure which GRASS version it includes. In Processing settings you can specify if GRASS 6.x or 7.x and where it is installed. Try to adjust these configurations to your setup. – underdark Dec 21 '14 at 19:38
yes, I use the stanalone installer . Following your advice, I deactivated grass 7 via the processing options and configured the path to qrass 6 correctly. this path was not correct, a leftover from an older qgis. Now I can run v.generalize, but in the end I get a new error: Output layer could not be opened and finally the message says that grass seems to be correctly installed and configured. could you please give me any suggestions or hints? – Kurt Dec 21 '14 at 20:04
Usually this error means that the geoprocessing failed at some stage. You have to examine the log which is generated while the tools run to see where the error happens. – underdark Dec 21 '14 at 20:21
ok, thanks for your support – Kurt Dec 21 '14 at 20:46

This can be seen as a preliminary to @Underdark's answer whereby you can clean the topology of the vector layer before generalizing. GRASS has a v.clean function which contains a number of tools to repair the layer such as:

  • snap which 'snaps' lines to the nearest vertex
  • rmdangle which removes any annoying dangles
  • rmdupl which removes duplicated geometry features

and various others shown in the image below:


You can also set the threshold depending on how sensitive you want the tools to run. Personally, I tend to use the Check Geometry Validity feature in QGIS (Vector > Geometry Tools > Check Geometry Validity) to check for any errors and if any exist, use the appropriate tool in v.clean. Once the errors are removed, you should be in a better position to generalize.

Hope this helps!

share|improve this answer
And if a simple vertex reduction is sufficient, v.generalize isn't necessary, as the prune tool can do that. – Gabor Farkas Dec 23 '14 at 12:27
thanks for your preliminary to @Underdark's answer, which contains valuable infos. although I did not explictly say it, of course the polygon-file, which I wanted to generalize, is topologically clean [because; garbage - garbage out :-)] – Kurt Dec 23 '14 at 19:09
@Kurt, that makes sense :) – Joseph Jan 5 '15 at 10:18

Have you tried using MapShaper? I've found this to be a good way of generalizing polygons; there's also an offline version if you want to download the code.

An alternative could be convert this to GeoJson, and then TopoJson which supports "topology-preserving shape simplification"

share|improve this answer
Have tried Mapshaper, it is really a great tool – Kurt Dec 21 '14 at 19:22
one more comment: As the title says: I am looking for a solution with qgis. Mapshaper imho it does not preserve topology ( Proof for yourself by doing a very strong generalisation!). Topojson: this is a bunch of javascript-sourcecode, which is imho only useful for programmers – Kurt Dec 21 '14 at 19:29
oops, missed the QGIS only aspect. QGIS does handle geojson though; I wonder if it would make sense to work in the topojson simplification functionality into a QGIS plugin to make it accessible to non-programmers – djq Dec 21 '14 at 20:03
I continue the off-topic line: OpenJUMP has a tool "Simplify Polygon Coverage" for this purpose. – user30184 Dec 22 '14 at 9:49

There is the same discussion here, my final answer being that SAGA does the job for you.

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Following your answer in that discussion, it seems SAGA does not preserve topology. At least not anymore. – Oystein Nov 28 '13 at 9:12

I just did a quick test, and the "Simplify Geometries' tool under the Vector menu appears to respect the topology. I tried with and without the "Enable topological editing" checked off under Snapping Options. Have you tried this?

EDIT: This was done directly on the polygon file--why would you convert to lines first?

share|improve this answer
Hi Darren, thanks for the hint I will try it with enablr topological editing – Kurt Feb 24 '12 at 14:33
Hi Darren, imho it does not respect topology. there is no difference with "enable topological editing". I supppose, this is because generalzing generates a new layer, while "enable topological editing" seems to work only with -selected - existing layers. Could you please do very very strong gerneralization and check again, if you have a correct topology now? thanks – Kurt Feb 24 '12 at 14:47
Kurt; Interesting. Looks like you're right when you do a strong generalization! Sorry! – Darren Cope Feb 24 '12 at 19:01
This checkbox is gone in QGIS 2.2 (perhaps earlier) in case anyone will search. – lynxlynxlynx Mar 22 '14 at 13:31

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.