<div dir="ltr"><div><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important"><strong>Short version:</strong> 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.</p>
<p style="margin:0px 0px 1.2em!important"><strong>Long version:</strong> I have <a href="https://drive.google.com/file/d/1khVbUnnCL-VZOzGh3XjeFr4wzTK5il34/view?usp=sharing">this layer</a> (7MB) with 19483 features. After using <a href="https://docs.qgis.org/testing/en/docs/user_manual/plugins/plugins_topology_checker.html"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">topology checker</code> plugin</a> I find the following topological errors:</p>
<ul style="margin:1.2em 0px;padding-left:2em">
<li style="margin:0.5em 0px">Gaps: 228 errors. Many of these gaps are the result of polygons with very small areas that should not exist.</li>
<li style="margin:0.5em 0px">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.</li>
</ul>
<p style="margin:0px 0px 1.2em!important">Additionally, if I enable <a href="https://docs.qgis.org/testing/en/docs/user_manual/plugins/plugins_geometry_checker.html"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">Geometry Checker</code></a> 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.</p>
<p style="margin:0px 0px 1.2em!important">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:</p>
<ul style="margin:1.2em 0px;padding-left:2em">
<li style="margin:0.5em 0px">Automated checks but manual fixes using <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">Topology checker</code> plugin.</li>
<li style="margin:0.5em 0px">Automated checks semi-automated fixes using <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">Geometry Checker</code> plugin.</li>
<li style="margin:0.5em 0px">Automated checks and fixes using GRASS’ <a href="https://grass.osgeo.org/grass74/manuals/v.clean.html"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">v.clean</code></a></li>
</ul>
<p style="margin:0px 0px 1.2em!important">If I am not wrong, after reading <a href="https://grass.osgeo.org/grass74/manuals/v.clean.html"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">v.clean</code></a>‘s documentation, it looks promising and I may solve most of the errors by using the <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">snap</code> tool, as if I am not wrong, would snap/move vertexes that are very close when they should be snapped instead.</p>
<p style="margin:0px 0px 1.2em!important">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.</p>
<p style="margin:0px 0px 1.2em!important">Unfortunately, I haven’t succeeded in doing so. I created <a href="https://drive.google.com/file/d/1ZmUoPuA-WN47P6mAZ55NDPQ-aFXkIccS/view?usp=sharing">the following model</a> but I might be doing something wrong since it creates more features instead of reducing its number.</p>
<p style="margin:0px 0px 1.2em!important">Could you please tell me if I did something wrong or if there are better ways to deal with it?</p>
<p style="margin:0px 0px 1.2em!important">Thank you<br></p></div></div><div><div dir="ltr" class="gmail_signature">Carlos Cámara<br><a href="http://carloscamara.es" target="_blank">http://carloscamara.es</a><br></div></div></div>