[GRASS-user] Hydrological grass question: main channel length for each subbasin

Michel Wortmann wortmann at pik-potsdam.de
Sun Feb 16 08:07:59 PST 2014

Hi list,
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.

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:

raster=mainstreams (thinned raster with unique categories for each subbasin)

r.to.vect to vectorise, this unfortunately gives me line segments 
crossing over subbasin boundaries

somehow make stream segments from each subbasin

v.to.db to measure the distance of each line segment

choose the longest distance for each subbasin

Any suggestions/help would be much appreciated.

More information about the grass-user mailing list