0

I have performed a set of geoprocessing tasks to produce a polygon output. The polygon output contains - what I would consider an invalid set of vertexes and as such, an invalid geometry. (see screen capture).

enter image description here The order of the vertexes in the vertex editor is, A, B C. The distance between A and B is a valid distance. The line between B and C goes right through vertex A, such that the gap between A-B line, and B-A line is so small it cannot be seen no matter how far I zoom in.

Upon running the 'Fix geometry' tool, no changes are made, nor does the 'Check Validity' tool (both GEOS and QGIS options) report any problems with the polygon. Additionally, running a small check in the python console using the validateGeometry() method also returns no errors.

v.clean also does not appear to have any function which would remedy this. Topology Checker plugin reports no problems.

However - Upon changing the Digitizing settings in the layer options and enabling the Geometry Checks 'Is Valid' option, i edited a different vertex (on the other side of the polygon) and was presented with the Geometry Validation 'Proposed: Self-Intersection' and cannot save the layer until the problem is fixed.

So I have lots of questions here as to why the Geometry Validation inside the digitizing tools pick up the error, yet other tools report valid geometry. However my real question is, is there a mechanism that prevents QGIS from creating these invalid geometries when performing geoprocessing tasks?

2
  • You're not the first to notice this and I'm sorry but I can't see there is a solution. The geoprocessing tools don't have a fuzzy tolerance that I can find but the edit module does, that is why your geometry is flagged during edit but not by the geometry checker. Try using v.clean grass.osgeo.org/grass82/manuals/v.clean.html to fix these in bulk as GRASS has a better grasp of topolological concepts. Depending on your previous geoprocessing operations if they can be done using GRASS you might avoid the need to clean. Commented Aug 8, 2023 at 5:03
  • Could you add one polygon as WKT? Maybe the polygon is valid, but it has a spike. There seems to a special spike remover plugin jkariscodes.github.io/polygon_spike_remover
    – user30184
    Commented Aug 8, 2023 at 13:40

0

Your Answer

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

Browse other questions tagged or ask your own question.