[postgis-users] PostGIS Geometry Clean function

Düster Horst Horst.Duester at bd.so.ch
Thu Apr 24 05:49:13 PDT 2008


In the last few days I developed a plpgsql function to clean not valid
polygon and linestring geometries. This function cleans all ring-self-
and self-intersections in PostGIS layers. 

The input is a valid or non valid geometry with one or more
self-intersections. The result is a clean Multi geometry where all
intersections are correct noded and divided into multiparts. I tested it
with polygon layers with more than 800000 objects and it works fine for
me. You can use the function with PostGIS >=  1.3.2. If you want to use
it with PostGIS 1.1.6 you have to modify the source and remove all ST_
from the specific funktion names. 

I hope the function could be helpful for you, for me it is.

Looking forward for your comments.

Best regards

Horst

------------------------------------------------

Dr. Horst Düster
GIS-Koordinator, Stv. Amtschef

Kanton Solothurn
Bau- und Justizdepartement
Amt für Geoinformation
SO!GIS Koordination
Rötistrasse 4
CH-4501 Solothurn

Telefon ++41(0)32 627 25 32
Telefax ++41(0)32 627 22 14

mailto:horst.duester at bd.so.ch
http://www.agi.so.ch


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080424/04c81c72/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cleanGeometry.sql
Type: application/octet-stream
Size: 3952 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080424/04c81c72/attachment.obj>


More information about the postgis-users mailing list