How to automate topology check/fix in QGIS?

by ccamara   Last Updated August 20, 2018 08:22 AM

Short version: I have a layer with 19483 features with plenty of topological errors and I would like to fix/review them as many as possible in an automated way but don't know how to do it. Additionally, since I will have to repeat the same process with many other layers with a similar amount of features and errors, I would like to create a model/script to save time.

Long version: I have this layer (7MB) with 19483 features. After using topology checker plugin I find the following topological errors:

  • Gaps: 228 errors. Many of these gaps are the result of polygons with very small areas that should not exist.
  • Must not overlap: 106 overlaps. Again, most of the problems arise because there are edges which are very close one to another (0.2mm close) but they should be in the same place instead.

Additionally, if I enable Geometry Checker plugin I found 186 sliver polygons, 159 polygons with less than 1sqm. I am not sure whether I may have even more errors that I have not yet discovered.

I am pretty new to topology (in fact, it is the first time I have to deal with it), but from what I have read, I understand that there are three ways to deal with topology checks/fixes:

  • Automated checks but manual fixes using Topology checker plugin.
  • Automated checks semi-automated fixes using Geometry Checker plugin.
  • Automated checks and fixes using GRASS' v.clean

If I am not wrong, after reading v.clean's documentation, it looks promising and I may solve most of the errors by using the snap tool, as if I am not wrong, would snap/move vertexes that are very close when they should be snapped instead.

Another interesting feature is that I can integrate v.clean in a model, which will make my life much better since I will have to repeat the same process with many other layers with a similar amount of features and errors.

Unfortunately, I haven't succeeded in doing so. I created the following model but I might be doing something wrong since it creates more features instead of reducing its number.

Could you please tell me if I did something wrong or if there are better ways to deal with it?

Thank you



Related Questions


Topology in QGIS

Updated February 21, 2018 19:22 PM



How to Properly Install GRASS

Updated July 06, 2017 23:22 PM

How to clean layers from non topological databases?

Updated September 04, 2017 08:22 AM