[postgis-users] st_union and simple line merge

Nicklas Avén nicklas.aven at jordogskog.no
Fri Dec 4 06:34:09 PST 2009


ok, I found:ST_LineMerge() I just expected that funtionality to be built in st_union but it will solve my problem :-) /Nicklas

2009-12-04 Nicklas Avén wrote:

>
Hallo>
 >
I found that st_union makes no effort to avoid multilinestring from st_union(linestring, linestring)>
 >
Is this expected?>
 >
an example:>
select st_astext(st_union('LINESTRING(1 1, 5 5)'::geometry, 'LINESTRING(5 5, 10 5)'::geometry));>
 >
returns MULTILINESTRING((1 1,5 5),(5 5,10 5))>
 >
and worst for practical cases if we input the linestrings in opposite order>
 >
select st_astext(st_union( 'LINESTRING(5 5, 10 5)'::geometry, 'LINESTRING(1 1, 5 5)'::geometry));>
 >
we get:>
 >
"MULTILINESTRING((5 5,10 5),(1 1,5 5))"
>>
This is not described in the documentation but it says that st_union will try to dissolv boudaries, and I can't imagine any simplier case to dissolv boundaries than this. >
 >
Is this the expected bahavior, is there any other way to merge simple linestrings to new linestrings?>
 >
Thanks>
Nicklas>
 >
 >
 >
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20091204/a81f83a5/attachment.html>


More information about the postgis-users mailing list