[QGIS-Developer] QGIS vs GEOS validity check

Bourdon, Jean-François (DIF) Jean-Francois.Bourdon at mffp.gouv.qc.ca
Fri Jun 3 12:25:53 PDT 2022


[Intranet logo]
Hi Devs,

I had a surprising issue with a specific vector layer and a clip operation. Validity check of the geometries seem to be done differently if native:clip is used inside a processing script or manually through the GUI as a vector layer containing a linestring with duplicate node like  LINESTRING ((0 0, 1 0, 1 0))  won't cause an issue when the clip is done with the GUI but will halt if done inside a processing script (on QGIS 3.22.6).

Also, if I run qgis:checkvalidity with the GEOS method, no error is found, but if I run it with the QGIS method, it finds one error (line 1 contains 2 duplicate nodes starting at vertex 2). So here are my questions: what exactly is checked when using the GEOS method and what is checked using the QGIS method? Also, do all processing tools (qgis: and native: ones) use the same kind of check?

I didn't find anywhere the details of what would be considered an error according to the "QGIS spec". Is it documented somewhere or do I need to look for hints inside the source code? As for the GEOS method, I only found some error examples in the PostGIS documentation and in a FME page (https://community.safe.com/s/article/invalid-ogc-geometry-examples). Is there an official documentation of what geometries are invalid regarding GEOS?

Thanks a lot for any pointer

Jean-François Bourdon, ing.f.
Analyste en télédétection
Direction des inventaires forestiers
Ministère des Forêts, de la Faune et des Parcs
5700, 4e Avenue Ouest, local A-108
Québec (Québec) G1H 6R1
Téléphone : 418 627-8669, poste 704304
jean-francois.bourdon at mffp.gouv.qc.ca
mffp.gouv.qc.ca<http://www.mffp.gouv.qc.ca/accueil.jsp>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220603/3b5ca7f7/attachment.htm>


More information about the QGIS-Developer mailing list