[postgis-users] ST_LineMerge with 4D support

Senn Peter Peter.Senn at bd.so.ch
Tue Aug 3 07:40:59 PDT 2010


Hi
 
I'm writing a function in PSQL to update a stream network containing
multilinestrings with XYZM.
The problem is to get a linestring by sewing together multilinestrings
with ST_LineMerge.
It seems to me that ST_LineMerge cannot handle M-values.
 
My approach is:
 
First I join two or more multilinestrings (ST_Union only gives XYZ)
 
select ST_AsEwkt(ST_Collect(ST_GeomFromText('MULTILINESTRING((1 1 11 1,
2 2 22 2, 3 3 33 3),(3 3 33 3, 4 4 44 4, 5 5 55 5))'),
ST_GeomFromText('MULTILINESTRING(( 5 5 55 5, 6 6 66 6, 7 7 77 7),(7 7 77
7, 8 8 88 8))')));
 
--> "GEOMETRYCOLLECTION(MULTILINESTRING((1 1 11 1,2 2 22 2,3 3 33 3),(3
3 33 3,4 4 44 4,5 5 55 5)),MULTILINESTRING((5 5 55 5,6 6 66 6,7 7 77
7),(7 7 77 7,8 8 88 8)))"
 
 
then I tried to make a linestring
 
select ST_AsEwkt(ST_Force_4D(ST_LineMerge(ST_CollectionExtract((select
ST_Collect(ST_GeomFromText('MULTILINESTRING((1 1 11 1, 2 2 22 2, 3 3 33
3),(3 3 33 3, 4 4 44 4, 5 5 55 5))'), ST_GeomFromText('MULTILINESTRING((
5 5 55 5, 6 6 66 6, 7 7 77 7),(7 7 77 7, 8 8 88 8))'))),2))));
 
--> "LINESTRING(1 1 11 0,2 2 22 0,3 3 33 0,4 4 44 0,5 5 55 0,6 6 66 0,7
7 77 0,8 8 88 0)"
 
I tried several ways but the M-Value is always lost. In the
documentation for St_LineMerge there is no hint about 3D or 4D support.
 
 
Regards,
Peter
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100803/515f0f1f/attachment.html>


More information about the postgis-users mailing list