<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html;">
<title>Scalix message content</title>
<style type="text/css">
<!--
.Normal {  text-align: left; text-indent:0pt; margin-top:0pt; margin-bottom:0pt; font-family: Arial; font-size: 12pt; }
.Default_Paragraph_Font {font-family: Arial; color: Black; background-color: white ; font-size: 12pt; font-weight: normal;  font-style: normal; font-variant: normal; vertical-align: normal; text-decoration: none;}
div.ltTOCtitle { font-family: Verdana; font-size: 8pt; font-weight: bold; text-align: center;}
div.ltTOCl1 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:32pt; text-indent:-32pt;}
div.ltTOCl2 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:40pt; text-indent:-32pt;}
div.ltTOCl3 {  font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:48pt; text-indent:-32pt;}
div.ltTOCl4 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:56pt; text-indent:-32pt;}
div.ltTOCl5 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:64pt; text-indent:-32pt;}
div.ltTOCl6 { font-family: Verdana; font-size: 8pt; font-weight: bold; margin-left:72pt; text-indent:-32pt;}
-->
</style>
</head>

<body>
<div class="Normal"><span style='font-size: 10pt; '>Mmmmm...</span><br><span style='font-size: 10pt; '>>Another
solution which *may* work is to replace the geometry by a buffer
</span><br><span style='font-size: 10pt; '>>of size 0 around the geometry in
your select statement </span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>No this is a bad idea. You
do not have any control about the result of your buffer(0). A better way is to
clean the polygon geometry with the cleangeometry() function you can download
from:</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>http://www.sogis1.so.ch/sogis/dl/postgis/cleangeometry.sql</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>The function cleans by
breaking the self-intersecting parts of your geometry into
multigeometries.</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Sometimes postgis throws
topology exeptions although your geometry is valid. In this case geos by itself
produces the error. Maybe this is the result of rounding problems and you don't
have any chance to solve the problem.</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Best
regards</span><br><span style='font-size: 10pt; '>Horst</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>------------------------------------------------</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Dr. Horst
Düster</span><br><span style='font-size: 10pt; '>GIS-Koordinator, Stv.
Amtschef</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Kanton
Solothurn</span><br><span style='font-size: 10pt; '>Bau- und
Justizdepartement</span><br><span style='font-size: 10pt; '>Amt für
Geoinformation</span><br><span style='font-size: 10pt; '>SO!GIS
Koordination</span><br><span style='font-size: 10pt; '>Rötistrasse
4</span><br><span style='font-size: 10pt; '>CH-4501 Solothurn</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Telefon ++41(0)32 627 25
32</span><br><span style='font-size: 10pt; '>Telefax ++41(0)32 627 22
14</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>mailto:horst.duester@bd.so.ch</span><br><span style='font-size: 10pt; '>http://www.agi.so.ch</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>-----Ursprüngliche
Nachricht-----</span><br><span style='font-size: 10pt; '>Von: Michael Michaud
[mailto:michael.michaud@free.fr]</span><br><span style='font-size: 10pt; '>Gesendet
am: Freitag, 29. August 2008 08:24</span><br><span style='font-size: 10pt; '>An:
PostGIS Users Discussion</span><br><span style='font-size: 10pt; '>Betreff: Re:
[postgis-users] ST_Unioning invalid multipolygons</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>David Jantzen a écrit
:</span><br><span style='font-size: 10pt; '>> Hi
again,</span><br><span style='font-size: 10pt; '>></span><br><span style='font-size: 10pt; '>>
I'm trying to ST_Union multipolygons from the Zillow neighborhood
data.</span><br><span style='font-size: 10pt; '>> When I do this I
occasionally
see:</span><br><span style='font-size: 10pt; '>></span><br><span style='font-size: 10pt; '>>
NOTICE:  TopologyException: found non-noded intersection
between</span><br><span style='font-size: 10pt; '>>
-73.812....</span><br><span style='font-size: 10pt; '>></span><br><span style='font-size: 10pt; '>>
This appears to be due to invalid geometries, as the following
query</span><br><span style='font-size: 10pt; '>> returns over a hundred
rows:</span><br><span style='font-size: 10pt; '>></span><br><span style='font-size: 10pt; '>>
select * from neighborhoods where not
ST_IsValid(the_geom)</span><br><span style='font-size: 10pt; '>></span><br><span style='font-size: 10pt; '>>
Can anyone suggest a workaround here?  The resulting geometry needs
to</span><br><span style='font-size: 10pt; '>> be a multipolygon.  Also, what
is ST_Is_valid actually testing for? 
The</span><br><span style='font-size: 10pt; '>> documentation isn't very
explicity about the definition of
validity.</span><br><span style='font-size: 10pt; '>>  
</span><br><span style='font-size: 10pt; '>Most of time, invalid polygons are
polygons with a self intersecting
</span><br><span style='font-size: 10pt; '>boundaries (as in the number '8') or
self-touching boundary (two non
</span><br><span style='font-size: 10pt; '>contiguous points of the boundary are
touching each other)</span><br><span style='font-size: 10pt; '>The best solution
is to correct those geometries if you
can.</span><br><span style='font-size: 10pt; '>Another solution which *may* work
is to replace the geometry by a buffer
</span><br><span style='font-size: 10pt; '>of size 0 around the geometry in your
select statement (using a 0-buffer </span><br><span style='font-size: 10pt; '>is
a work-around which generally works with JTS library from which
</span><br><span style='font-size: 10pt; '>postgis functions are
derived).</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>Michaël</span><br><span style='font-size: 10pt; '>>
Thanks,</span><br><span style='font-size: 10pt; '>>
David</span><br><span style='font-size: 10pt; '>></span><br><span style='font-size: 10pt; '>>
_______________________________________________</span><br><span style='font-size: 10pt; '>>
postgis-users mailing list</span><br><span style='font-size: 10pt; '>>
postgis-users@postgis.refractions.net</span><br><span style='font-size: 10pt; '>>
http://postgis.refractions.net/mailman/listinfo/postgis-users</span><br><span style='font-size: 10pt; '>></span><br><span style='font-size: 10pt; '>></span><br><span style='font-size: 10pt; '>>
</span></div>
<br>
<div class="Normal"><span style='font-size: 10pt; '>_______________________________________________</span><br><span style='font-size: 10pt; '>postgis-users
mailing
list</span><br><span style='font-size: 10pt; '>postgis-users@postgis.refractions.net</span><br><span style='font-size: 10pt; '>http://postgis.refractions.net/mailman/listinfo/postgis-users</span></div>



</body>

</html>