On Mon, 28 Dec 2020 08:10:50 -0800 (PST), Andrea Borruso wrote:
> Hi,
> is there a SQL way to run RTTOPO SanitizeGeometry command of the
> spatialite-gui app (using the default sanitize option)?
>
ciao Andrea,
the GUI wizard is fully based on the standard RTTOPO MakeValid()
function, it simply add some bonus value such as producing an
HTML detailed report.
you can get the same practical effect by using a pure SQL
statement as:
UPDATE geom = MakeValid(geom) FROM my_table;
or even better:
UPDATE geom = MakeValid(geom)
FROM my_table
WHERE ST_IsValid(geom) <> 1;
happy new year,
Sandro