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

  • Are there any news on this issue?
    – user23603
    Nov 28, 2013 at 9:11
  • unfortunately: no
    – Kurt
    Nov 30, 2013 at 19:39

5 Answers 5


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

  • 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, 2014 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, 2014 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, 2014 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, 2014 at 20:21

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!

  • 3
    And if a simple vertex reduction is sufficient, v.generalize isn't necessary, as the prune tool can do that. Dec 23, 2014 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, 2014 at 19:09
  • @Kurt, that makes sense :)
    – Joseph
    Jan 5, 2015 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" https://github.com/mbostock/topojson

  • Have tried Mapshaper, it is really a great tool
    – Kurt
    Dec 21, 2014 at 19:22
  • 1
    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, 2014 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, 2014 at 20:03
  • I continue the off-topic line: OpenJUMP has a tool "Simplify Polygon Coverage" for this purpose.
    – user30184
    Dec 22, 2014 at 9:49

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?

  • Hi Darren, thanks for the hint I will try it with enablr topological editing
    – Kurt
    Feb 24, 2012 at 14:33
  • 1
    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, 2012 at 14:47
  • 1
    Kurt; Interesting. Looks like you're right when you do a strong generalization! Sorry! Feb 24, 2012 at 19:01
  • 1
    This checkbox is gone in QGIS 2.2 (perhaps earlier) in case anyone will search. Mar 22, 2014 at 13:31

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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