<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">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).<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">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).<br></div><div class="gmail_default" style="font-family:monospace,monospace">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.<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br>Else, <br></div><div class="gmail_default" style="font-family:monospace,monospace">you are up to use some nasty workaround I suppose (playing with buffers on your original river surface, testing which segment intersects etc. ).<br></div><div class="gmail_default" style="font-family:monospace,monospace">I tried that but it ends up being more work (and more corner cases) than doing the things properly (in my experience).<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">Cheers,<br></div><div class="gmail_default" style="font-family:monospace,monospace">Rémi-C<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-08 16:42 GMT+02:00 toni hernández <span dir="ltr"><<a href="mailto:toni@sigte.udg.edu" target="_blank">toni@sigte.udg.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<font face="Arial">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>
<br>
</font>
<div>-- <br>
<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" 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><br>
<br>
</span></div>
</div>
<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><br></blockquote></div><br></div>