The ST_SnapToGrid doesn't help.  It changes the points slightly, but Union still fails.  I tried simplifying my input linework, snapping to grids of various sizes, nothing seem to make it happy.  I'm trying to reduce the amount of lines being unioned to see if that either fixes it or at least I can get a small enough test case to post here.<br>
<br><div class="gmail_quote">On Tue, Jul 27, 2010 at 10:59 AM, Jeff Adams <span dir="ltr"><<a href="mailto:jadams@azavea.com">jadams@azavea.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
The challenge is I don't know the exact point it is unhappy about.  If<br>
I check the one in the error message, none of my linestrings intersect<br>
it, which means it is probably being printed with insufficient<br>
precision.  I have 19 linestrings that have a point that could be<br>
printed as -118.296 34.1185 due to rounding.<br>
<br>
Also, the two linestrings printed in the error aren't real inputs,<br>
they must be something created internally by ST_Union as it is<br>
processing.<br>
<br>
I tried adding a ST_SnapToGrid(..., 0.00001)  (0.00001 is very roughly<br>
a meter in lat/lon) and it has been running for almost 40 minutes, so<br>
it is either slower than before or it has made it further than before<br>
:-).<br>
<font color="#888888"><br>
Jeff<br>
</font><div><div></div><div class="h5"><br>
On Tue, Jul 27, 2010 at 10:27 AM, Nicolas Ribot <<a href="mailto:nicolas.ribot@gmail.com">nicolas.ribot@gmail.com</a>> wrote:<br>
>> ST_IsValid returns true for all of them.  I'll try reducing the<br>
>> precision slightly, though I'm later going to do point-in-poly checks<br>
>> against some other original input data and the reduced precision will<br>
>> increase the chances of inaccurate results.<br>
>><br>
><br>
> Ok,<br>
> I'm wondering if using the notice message could be used in conjunction<br>
> with linear referencing functions to add the missing point to the<br>
> failing linestring(s):<br>
><br>
> 1- identify failing linestrings (or offending coordinates, then<br>
> finding the closest linestring to this point)<br>
> 2- complete these linestrings with new points built from coordinates<br>
> 3- relaunch the union procedure.<br>
><br>
> Though I've never done this.<br>
><br>
> Nicolas<br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
><br>
</div></div></blockquote></div><br>