[postgis-users] function from multilinestring to linestring

toni hernnadez thernandez at correo.giscampus.org
Thu Apr 20 07:58:52 PDT 2006


hi Markus,
Up to now I've using the 1.1.1 version of postgis.

Here is the data I've been testing the geomunion with

MULTILINESTRING((498376.89 651569.6,498372.28 651571.89),(498372.28 
651571.89,498371.77 651576.05))

a query like the next one is returning a multinestring:

select astext(geomunion(geomfromtext('MULTILINESTRING((498376.89 
651569.6,498372.28 651571.89),(498372.28 651571.89,498371.77 
651576.05))',23031)))

Eventually I manage to update to postgis 1.1.2 but the databases I was 
using do not accept the new funcions (like linemerge)
What am I missing?

Markus Schaber wrote:

>Hi, Toni,
>
>toni hernnadez wrote:
>
>  
>
>>Is there any way to convert a multilinestring object to linestring?
>>    
>>
>
>Not generally, as a LineString contains exactly _one_ sequence of
>connected points, and a MultiLineString can contain more of them.
>
>For some corner cases (e. G. adjacent or overlapping LineStrings) you
>can try LineMerge() or GeomUnion() to connect the pieces together.
>
>The first LineString in a MultiLineString can be fetched via
>GeometryN(yourlinestring,1).
>
>
>HTH,
>Schabi
>  
>



More information about the postgis-users mailing list