In trunk version (2.0.0) of postgis there is a new function<br>ST_MakeValid(..) that try to resolve invalidity.<br>It work pretty well.<br><br>ps:<br><br>Because its goal is not lost no-one vertex, sometimes return a GeometryCollection.<br>
so is necessary extract from the output the polygon part of collection.<br><br>sometimes like:<br><br>...<br>(<br>CASE <br> WHEN <br> ST_GeometryType("geom")='ST_GeometryCollection' <br>
THEN <br> ST_CollectionExtract("geom", 2) <br> ELSE <br> "geom"<br>) as geom<br>-- <br><br>-----------------<br>Andrea Peri<br>
. . . . . . . . . <br>qwerty àèìòù<br>-----------------<br><br>