<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Arial">thanks Hugues,<br>
      <br>
      The thing is that with st_Dump I get all the linestrings of a
      river but there is no way (that I know of) that I can order all
      the segments and get the "real" start /end points of the whole
      river.<br>
      <br>
    </font>
    <div class="moz-signature"><span style="font-size:8.5pt">
        <b>Toni Hernández Vallès</b>
        <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><br>
        <br>
      </span></div>
    <div class="moz-cite-prefix">On 09/06/2015 08:56, Hugues François
      wrote:<br>
    </div>
    <blockquote
cite="mid:3CB901080554B04881D30F111F62D9300508B032@nadia.grenoble.cemagref.fr"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
            lang="EN-GB">Hello,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
            lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
            lang="EN-GB">I think ST_Dump could help to deal with
            multilinestrings: <a moz-do-not-send="true"
              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
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
            lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
            lang="EN-GB">Hugues.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
            lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
            lang="EN-GB"><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">
                <a class="moz-txt-link-abbreviated" href="mailto:postgis-users-bounces@lists.osgeo.org">postgis-users-bounces@lists.osgeo.org</a>
                [<a class="moz-txt-link-freetext" href="mailto:postgis-users-bounces@lists.osgeo.org">mailto:postgis-users-bounces@lists.osgeo.org</a>] <b>De la
                  part de</b> toni hernández<br>
                <b>Envoyé :</b> mardi 9 juin 2015 08:09<br>
                <b>À :</b> <a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><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 moz-do-not-send="true" href="mailto:toni@sigte.udg.edu">toni@sigte.udg.edu</a>
              <br>
              <br>
              <a moz-do-not-send="true" href="http://www.sigte.udg.edu">http://www.sigte.udg.edu</a><br>
              Twitter <a moz-do-not-send="true"
                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 moz-do-not-send="true"
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 moz-do-not-send="true"
                  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 moz-do-not-send="true"
                      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 moz-do-not-send="true"
                        href="mailto:toni@sigte.udg.edu" target="_blank">toni@sigte.udg.edu</a>
                      <br>
                      <br>
                      <a moz-do-not-send="true"
                        href="http://www.sigte.udg.edu" target="_blank">http://www.sigte.udg.edu</a><br>
                      Twitter <a moz-do-not-send="true"
                        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 moz-do-not-send="true"
                  href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
                <a moz-do-not-send="true"
                  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 moz-do-not-send="true" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><o:p></o:p></pre>
          <pre><a moz-do-not-send="true" 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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>