[postgis-users] Union fails on 2389 linestrings.

Jeff Adams jadams at azavea.com
Tue Jul 27 07:59:21 PDT 2010


The challenge is I don't know the exact point it is unhappy about.  If
I check the one in the error message, none of my linestrings intersect
it, which means it is probably being printed with insufficient
precision.  I have 19 linestrings that have a point that could be
printed as -118.296 34.1185 due to rounding.

Also, the two linestrings printed in the error aren't real inputs,
they must be something created internally by ST_Union as it is
processing.

I tried adding a ST_SnapToGrid(..., 0.00001)  (0.00001 is very roughly
a meter in lat/lon) and it has been running for almost 40 minutes, so
it is either slower than before or it has made it further than before
:-).

Jeff

On Tue, Jul 27, 2010 at 10:27 AM, Nicolas Ribot <nicolas.ribot at gmail.com> wrote:
>> ST_IsValid returns true for all of them.  I'll try reducing the
>> precision slightly, though I'm later going to do point-in-poly checks
>> against some other original input data and the reduced precision will
>> increase the chances of inaccurate results.
>>
>
> Ok,
> I'm wondering if using the notice message could be used in conjunction
> with linear referencing functions to add the missing point to the
> failing linestring(s):
>
> 1- identify failing linestrings (or offending coordinates, then
> finding the closest linestring to this point)
> 2- complete these linestrings with new points built from coordinates
> 3- relaunch the union procedure.
>
> Though I've never done this.
>
> Nicolas
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list