Probably you can look at this (pgrouting)<br><br><a href="http://www.pgrouting.org/">http://www.pgrouting.org/</a><br><a href="http://underdark.wordpress.com/2011/02/07/a-beginners-guide-to-pgrouting/">http://underdark.wordpress.com/2011/02/07/a-beginners-guide-to-pgrouting/</a><br>
<br>or as I see you use qgis you also can try this qgis plugin<br><br><br><a href="http://www.youtube.com/watch?v=T2JTuQOBXz0">http://www.youtube.com/watch?v=T2JTuQOBXz0</a><br><a href="http://gis-lab.info/qa/road-graph-eng.html">http://gis-lab.info/qa/road-graph-eng.html</a><br>
<br><br>Just adapt for your needs.<br><br><br>However it depends what kind and how many data you have.<br><br><br><br><div class="gmail_quote">2011/4/26 George Silva <span dir="ltr"><<a href="mailto:georger.silva@gmail.com">georger.silva@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">ooops, prior to max use st_length!<br>
<div><div></div><div class="h5"><br>
On 4/26/11, George Silva <<a href="mailto:georger.silva@gmail.com">georger.silva@gmail.com</a>> wrote:<br>
> hello marcello. what is your data model? dependng on the data model<br>
> (if you have a column, lets say, rivername) you can use a group by<br>
> clause and st_collect on your geometry field. ex:<br>
><br>
> select rivername, max(st_collect(the_geom)) from rivers group by rivername<br>
><br>
> the intersects clause its up to you , depending on your néds. not<br>
> tested, but should work.<br>
><br>
> On 4/26/11, Marcello Benigno <<a href="mailto:benigno.marcello@gmail.com">benigno.marcello@gmail.com</a>> wrote:<br>
>> Hi All,<br>
>><br>
>> I need a query that returns the greater length of river within a<br>
>> watershed. Does<br>
>> anyone have any suggestions on how I can solve this problem?<br>
>><br>
>> The rivers are formed by segments. if each were a continuous line would<br>
>> be<br>
>> easy.<br>
>><br>
>> Here is a print-screen of the problem, in yellow is what would be the<br>
>> result<br>
>> of<br>
>> the query.<br>
>><br>
>> Thanks in advance,<br>
>> --<br>
>> *Marcello Benigno B. de Barros Filho*<br>
>> Prof. do Curso Superior de Tecnologia em Geoprocessamento - IFPB<br>
>> Mestre em Ciências Geodésicas e Tecnologias da Geoinformação - UFPE<br>
>> <a href="http://profmarcello.blogspot.com" target="_blank">http://profmarcello.blogspot.com</a><br>
>> <a href="http://about.me/marcello.benigno" target="_blank">http://about.me/marcello.benigno</a><br>
>><br>
><br>
><br>
> --<br>
> George R. C. Silva<br>
><br>
> Desenvolvimento em GIS<br>
> <a href="http://geoprocessamento.net" target="_blank">http://geoprocessamento.net</a><br>
> <a href="http://blog.geoprocessamento.net" target="_blank">http://blog.geoprocessamento.net</a><br>
><br>
<br>
<br>
--<br>
George R. C. Silva<br>
<br>
Desenvolvimento em GIS<br>
<a href="http://geoprocessamento.net" target="_blank">http://geoprocessamento.net</a><br>
<a href="http://blog.geoprocessamento.net" target="_blank">http://blog.geoprocessamento.net</a><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br>