<div dir="ltr">Michel,<div><br></div><div>If you do what you suggest, but first apply a MASK using each subbasin; so, when you calculate the statistics, they will be for one subbasin at a time; with a very simple script you could loop through each subbasin.</div>
<div><br></div><div>I hope this helps.</div><div><br></div><div>Cheers!</div><div>Tom</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 16, 2014 at 11:07 AM, Michel Wortmann <span dir="ltr"><<a href="mailto:wortmann@pik-potsdam.de" target="_blank">wortmann@pik-potsdam.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi list,<br>
I'm looking for a way to calculate the main channel length and width for a large number of subbasins within a river basin. I understand that the r.stream.* addon / R.basin gives me the main channel length along with a tone of other statistics but only for one catchment. Of course, I could loop over all my subbasins and calculate the statistics one by one, but I fear that will be time consuming and I dont actually need all the other analysis.<br>
<br>
I have got an efficient way to calculate the mainstream for each subbasin as a vector, but I'm struggling to get from there to the distance of the longest segment in each subbasin. Maybe someone has an idea to complete this idea of a work flow:<br>
<br>
raster=mainstreams (thinned raster with unique categories for each subbasin)<br>
<br>
r.to.vect to vectorise, this unfortunately gives me line segments crossing over subbasin boundaries<br>
<br>
somehow make stream segments from each subbasin<br>
<br>
v.to.db to measure the distance of each line segment<br>
<br>
choose the longest distance for each subbasin<br>
<br>
<br>
Any suggestions/help would be much appreciated.<br>
Regards,<br>
Michel<br>
<br>
______________________________<u></u>_________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/grass-user</a><br>
</blockquote></div><br><br>
</div></div>