<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"Préformaté HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.PrformatHTMLCar
{mso-style-name:"Préformaté HTML Car";
mso-style-priority:99;
mso-style-link:"Préformaté HTML";
font-family:Consolas;
color:black;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hello,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I think ST_Dump could help to deal with multilinestrings: <a href="http://postgis.net/docs/ST_Dump.html">http://postgis.net/docs/ST_Dump.html</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hugues.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>De :</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> postgis-users-bounces@lists.osgeo.org [mailto:postgis-users-bounces@lists.osgeo.org] <b>De la part de</b> toni hernández<br><b>Envoyé :</b> mardi 9 juin 2015 08:09<br><b>Ŕ :</b> postgis-users@lists.osgeo.org<br><b>Objet :</b> Re: [postgis-users] Get only the main river. Smoothline???<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-family:"Arial","sans-serif"'>Thanks Remi,<br><br>I thought that but I have no starting/ending points. St_StartPoint and St_EndPoint are not working with MultiLinestrings<br>I'll give it some more intense thought. :)<br><br>Cheers.</span><o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:8.5pt'>Toni Hernández Vallčs</span></b><span style='font-size:8.5pt'> <br>Servei de Sistemes d'Informació Geogrŕfica i Teledetecció<br>-<br>Universitat de Girona<br><b>SIGTE</b><br>-<br>Pl. Ferrater Mora 1<br>17071 Girona<br>Tel +34 972 418 039 (7026 intern)<br><a href="mailto:toni@sigte.udg.edu">toni@sigte.udg.edu</a> <br><br><a href="http://www.sigte.udg.edu">http://www.sigte.udg.edu</a><br>Twitter <a href="http://twitter.com/SIGTE_UDG">http://twitter.com/SIGTE_UDG</a></span><o:p></o:p></p></div><div><p class=MsoNormal>On 08/06/2015 17:45, Rémi Cura wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-family:"Courier New"'>if you have start and end point of geom B,<br>you can get the river path with a shortest path method (one liner using python, can be done in few hours using plpgsql).<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>The idea is that you cut your geom into segments(pairs of points)<br>, the length of the segment is the weight of this edge <br>, and you know which segment is connected to which segment (adjacency graph).<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Then you use <a href="http://networkx.lanl.gov/reference/generated/networkx.algorithms.shortest_paths.generic.shortest_path.html#networkx.algorithms.shortest_paths.generic.shortest_path">Networkx </a>shortest path distance.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'><br>Else, <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>you are up to use some nasty workaround I suppose (playing with buffers on your original river surface, testing which segment intersects etc. ).<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-family:"Courier New"'>I tried that but it ends up being more work (and more corner cases) than doing the things properly (in my experience).<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Cheers,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Rémi-C<o:p></o:p></span></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>2015-06-08 16:42 GMT+02:00 toni hernández <<a href="mailto:toni@sigte.udg.edu" target="_blank">toni@sigte.udg.edu</a>>:<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-family:"Arial","sans-serif"'>Hi everyone,<br><br>I have a multilinestring with a river and all its afluents as you can see in this image <br><a href="http://sigserver4.udg.edu/apps/geometries.png" target="_blank">http://sigserver4.udg.edu/apps/geometries.png</a><br><br>I got geometry A using St_StraithSkeleton.<br><br>Is there a way to go from geometry A to geometry B?? <br>Maybe something similar to SmoothLine???<br><br></span><o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'>-- <br><b><span style='font-size:8.5pt'>Toni Hernández Vallčs</span></b><span style='font-size:8.5pt'> <br>Servei de Sistemes d'Informació Geogrŕfica i Teledetecció<br>-<br>Universitat de Girona<br><b>SIGTE</b><br>-<br>Pl. Ferrater Mora 1<br>17071 Girona<br>Tel +34 972 418 039 (7026 intern)<br><a href="mailto:toni@sigte.udg.edu" target="_blank">toni@sigte.udg.edu</a> <br><br><a href="http://www.sigte.udg.edu" target="_blank">http://www.sigte.udg.edu</a><br>Twitter <a href="http://twitter.com/SIGTE_UDG" target="_blank">http://twitter.com/SIGTE_UDG</a></span><o:p></o:p></p></div></div><p class=MsoNormal><br>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal><br><br><br><o:p></o:p></p><pre>_______________________________________________<o:p></o:p></pre><pre>postgis-users mailing list<o:p></o:p></pre><pre><a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><o:p></o:p></pre><pre><a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><o:p></o:p></pre></blockquote><p class=MsoNormal><o:p> </o:p></p></div></body></html>