<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>

<META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Courier New" size=2><SPAN 
class=153590114-03082010>Hi</SPAN></FONT>
</DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=153590114-03082010></SPAN></FONT> 
</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=153590114-03082010>I'm writing 
a function in PSQL to update a stream network containing multilinestrings with 
XYZM.</SPAN></FONT>
</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=153590114-03082010>The problem 
is to get a linestring by sewing together multilinestrings with 
ST_LineMerge.</SPAN></FONT>
</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=153590114-03082010>It seems to 
me that ST_LineMerge cannot handle M-values.</SPAN></FONT>
</DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=153590114-03082010></SPAN></FONT> 
</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=153590114-03082010>My approach 
is:</SPAN></FONT>
</DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=153590114-03082010></SPAN></FONT> 
</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=153590114-03082010>First I join 
two or more multilinestrings (ST_Union only gives XYZ)</SPAN></FONT>
</DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=153590114-03082010></SPAN></FONT> 
</DIV>
<DIV><FONT face="Courier New" size=2>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))'),<SPAN class=153590114-03082010> 
</SPAN>ST_GeomFromText('MULTILINESTRING(( 5 5 55 5, 6 6 66 6, 7 7 77 7),(7 7 77 
7, 8 8 88 8))')));</FONT>
</DIV>
<DIV><FONT face="Courier New" size=2></FONT> 
</DIV>
<DIV><SPAN class=153590114-03082010><FONT face="Courier New" size=2>--> 
"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)))"</FONT></SPAN>
</DIV>
<DIV><FONT face="Courier New" size=2></FONT> 
</DIV>
<DIV><FONT face="Courier New" size=2></FONT> 
</DIV>
<DIV><SPAN class=153590114-03082010><FONT face="Courier New" size=2>then I tried 
to make a linestring</FONT></SPAN>
</DIV>
<DIV><SPAN class=153590114-03082010><FONT face="Courier New" 
size=2></FONT></SPAN> 
</DIV>
<DIV><SPAN class=153590114-03082010><FONT face="Courier New" size=2>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))));</FONT></SPAN>
</DIV>
<DIV><SPAN class=153590114-03082010><FONT face="Courier New" 
size=2></FONT></SPAN> 
</DIV>
<DIV><SPAN class=153590114-03082010><FONT face="Courier New" size=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)"</FONT></SPAN>
</DIV>
<DIV><SPAN class=153590114-03082010><FONT face="Courier New" 
size=2></FONT></SPAN> 
</DIV>
<DIV><SPAN class=153590114-03082010><FONT face="Courier New" size=2>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.</FONT></SPAN>
</DIV>
<DIV><SPAN class=153590114-03082010><FONT face="Courier New" 
size=2></FONT></SPAN> 
</DIV>
<DIV><FONT face="Courier New"></FONT><SPAN class=153590114-03082010><FONT 
size=2><FONT face="Courier New"></FONT> 
</DIV>
<DIV><FONT face="Courier New">Regards,</FONT>
</DIV>
<DIV><FONT face="Courier New">Peter</FONT>
</DIV>
<DIV></FONT></SPAN> 
</DIV></BODY></HTML>