{: .no_toc }
- TOC {:toc}
https://gis.stackexchange.com/questions/1060/what-are-the-implications-of-invalid-geometries https://gis.stackexchange.com/a/11234/14766
ALTER TABLE public.my_valid_table
ADD CONSTRAINT enforce_valid_geom CHECK (st_isvalid(geom));
https://gis.stackexchange.com/questions/15286/ring-self-intersections-in-postgis The question and standard answer (buffer(0) are fairly mundane. But note the answer where the user uses MakeValid and keeps only the result polygons with significant area. Might be a good option to MakeValid?
Gives outline for function cleanPolygon
but does not provide source
https://gis.stackexchange.com/questions/173977/how-to-remove-spikes-in-polygons-with-postgis
Solutions
Some custom code implementations:
https://trac.osgeo.org/postgis/wiki/UsersWikiExamplesSpikeRemover
https://gasparesganga.com/labs/postgis-normalize-geometry/
https://gis.stackexchange.com/questions/15127/how-to-rectify-the-walls-of-buildings-in-postgis
Solution
- Simplify the polygon with a very small distance tolerance, using one of: