<div dir="ltr">One of the most discussed topics during my workshops is geometry validation.<div><br><div>As you know not all softwares agree on geometry validity, but we have an OGC specification that most FOSS softwares adopt which define validity with good detail. We can agree on it or not, but I think we cannot accept having different tools behaving differently.</div></div><div><br></div><div>Topology validator and QgsGeometryValidator (which is use by Processing Check Geometry algorithm) give different results in case of a "self-intersecting polygon which defines a (false) hole".</div><div>I use this definition as a translation of the GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE GEOS flag which is used by the QgsGeometryValidator. This flag make GEOS validator stick with Esri's point of view, so the following polygon is ok for it but not for OGC:</div><div><br></div><div>POLYGON ((200 400, 400 400, 400 200, 300 200, 350 250, 250 250, 300 200, 200 200, 200 400))<br></div><div><br></div><div>If you test its validity in Spatialite or PostGIS with ST_IsValid, or if you test it with the Topology Validation tool, you will obtain that it's not valid.</div><div>If you test it with Check Geometry algorithm it will result as valid.</div><div><br></div><div>Here the source lines of the two validations:</div><div><br></div><div>Topology validator: <a href="https://github.com/qgis/QGIS/blob/master/src/plugins/topology/topolTest.cpp#L871">https://github.com/qgis/QGIS/blob/master/src/plugins/topology/topolTest.cpp#L871</a></div><div>QgsGeometryValidator: <a href="https://github.com/qgis/QGIS/blob/master/src/core/qgsgeometryvalidator.cpp#L231">https://github.com/qgis/QGIS/blob/master/src/core/qgsgeometryvalidator.cpp#L231</a></div><div><br></div><div>If we want to mantain the opportunity to set that flag, we should manage it as an option. </div><div>From the user point of view maybe it should be an additional parameter to set/unset. Something like "OGC strict validity" or maybe something more meaningful for the layman.</div><div><br></div><div>Giovanni</div></div>