Database Reference
In-Depth Information
Note
ST_MakeValid requires GEOS 3.3.0 or higher; check whether or not
your system has its support using the PostGIS_full_version func-
tion as follows:
postgis_cookbook=# SELECT
PostGIS_full_version();
postgis_full_version
---------------------------------------
POSTGIS="2.0.1 r9979"
GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel.
4.7.1, 23 September 2009" GDAL="GDAL
2.0dev, released 2011/12/29"
LIBXML="2.7.8" TOPOLOGY RASTER
(1 row)
3. Now,usingthe ST_MakeValid function,addanewrecordinthepreviously
created table with the valid version of the same geometry:
postgis_cookbook=# INSERT INTO
chp03.invalid_geometriesVALUES
('repaired', (SELECT
ST_MakeValid(the_geom)
FROM chp03.invalid_geometries));
4. OpenthisgeometryonyourDesktopGIS;theinvalidgeometryhasjustone
self-intersectingringthatproducesaholeinitsinternal.Whilethisisaccep-
ted in the ESRI shapefile format specification (that was the original dataset
youimported),theOGCstandarddoesnotallowfortheself-intersectingring,
so neither does PostGIS.
Search WWH ::




Custom Search