[Qgis-user] How to automate topology check/fix in QGIS and add it to a model?

Carlos Cámara carlos.camara at gmail.com
Mon Aug 20 01:19:18 PDT 2018


*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
<https://drive.google.com/file/d/1khVbUnnCL-VZOzGh3XjeFr4wzTK5il34/view?usp=sharing>
(7MB) with 19483 features. After using topology checker plugin
<https://docs.qgis.org/testing/en/docs/user_manual/plugins/plugins_topology_checker.html>
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
<https://docs.qgis.org/testing/en/docs/user_manual/plugins/plugins_geometry_checker.html>
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
   <https://grass.osgeo.org/grass74/manuals/v.clean.html>

If I am not wrong, after reading v.clean
<https://grass.osgeo.org/grass74/manuals/v.clean.html>‘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
<https://drive.google.com/file/d/1ZmUoPuA-WN47P6mAZ55NDPQ-aFXkIccS/view?usp=sharing>
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
Carlos Cámara
http://carloscamara.es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180820/8eac0c01/attachment.html>


More information about the Qgis-user mailing list