I'm currently using FME to validate geometries, coming from 3rd parties, making sure there to OGC Standards.

I was hoping to be able to replicate these checks in QGIS, but find the tools available (Check Geometries Plugin, Topology Checker and Check Validity) do not currently flag the issues to the same degree as FME. We need a way these 3rd Party's can check the geometries and find the issues, before sending them onto us, but preferably through QGIS.

Currently, FME is flagging an issue Hole Outside of Shell. Indeed, when I check the datasets with the issue and show/label the vertices it shows the problem

Hole outside shell

Is anyone aware of a more rigorous tool/plugin preferably open source, which can be used to check validity of Geometries to OGC standards? Or alternatively, does anyone have a way I can do this in QGIS?


POLYGON ((316090 271359.55790742964,316090 271358,316094 271358,316094 271350,316098 271350,316098 271342,316102 271342,316102 271338,316106 271338,316106 271334,316104 271334,316104 271332.59936407575,316078.7082847951 271332.5992296712,316078.7993720204 271359.55784790637,316090 271359.55790742964),(316092 271350,316092 271348,316094 271348,316094 271350,316092 271350),(316100 271338,316100 271336,316102 271336,316102 271338,316100 271338))

Typical though, the extracted WKT doesn't have the issue, the geometry string exceeds the character limit for the post, so I had to clip it, evidently in clipping it, and converting it to WKT, the issue was addressed...

  • Please add the invalid geometry as WKT.
    – user30184
    Mar 27 at 13:23
  • Could you put the invalidid geometry into some download service? What error did the Check validity tool write into the Error output layer?
    – user30184
    Mar 27 at 15:11
  • 2
    rounding of precise values can cause geometry errors
    – nmtoken
    Mar 27 at 16:18

1 Answer 1


Unfortunatly the dataste im working on has in excess of 1.5 million polygon geometries and I cant share it as its also sensative information. My access to download services is also restricted, as is access to those by 3rd Parties.

I have found a way to validate the data, which may work as a starting point. using a Bath Script in Windows, I can run the following

for %%f in (*.shp) do (
ogrinfo -sql "ALTER TABLE %%~nf ADD COLUMN validity character(60)" %%~nxf
ogrinfo -dialect sqlite -sql "UPDATE %%~nf SET validity = (ST_IsValidReason(Geometry,0))" %%~nxf 

This adds a new column to the data which runs as close to a OGC validation as I can determine.

Any ideas on how this might be developed or improved are welcome.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.