I work in a mixed open/closed-source GIS office where we have both open source (QGIS, and soon PostGIS) and Esri (ArcMap, ArcGIS Pro) available.
I bring in OpenStreetMap regularly and have to fix the polygon layer because of illegal geometries. Typically I do this by casting the data to a shapefile and then running Esri's Repair Geometry function. Reasonably fast and efficient. But I would like an open-source version of doing the same thing.
Before this question is marked as a duplicate, I did review:
Repairing geometry using QGIS? (I don't have a few errors, I have many thousands; thus I want to avoid the GUI in favor of CLI, plus GRASS is not working right in my version and I have no access to v.clean
(Boundless Desktop 1.0)), and
Fixing geometry validity errors in QGIS? (liblwgeom
processing plugin seems like it would meet my needs but there is no clear explanation of "Here is how you find the path to liblwgeom
on Windows, once you install the plugin.")
I would like to use SpatiaLite's MakeValid()
function but our version of QGIS does not contain it. So instead I am trying to do a Buffer()
of zero, and outputting that to a new spatial table in the same SpatiaLite db.
I get that this brushes up against SE rules but I have no real starting code. When I try to use either Qspatialite plugin or the QGIS Database Manager to write:
(this is in the Qspatialite plugin SQL screen, setting Option to "Create Spatial Table & Load in QGIS):
Buffer( "multipolygons".'GEOMETRY', 0)
it gives me this response:
The SQL query seems to be invalid.
near "Buffer": syntax error
I get that it's a syntax error, but I have not found any resources for those of us who are not DBAs already, that bridge the gap between SpatiaLite documentation (theoretical) and the QGIS SQL window(s) (working with your own real data).
My desired end result is a permanent spatial table of the corrected polygon layer.