[GRASS-dev] r.watershed flow option

Markus Metz markus.metz.giswork at googlemail.com
Mon May 24 04:52:32 EDT 2010


Hamish wrote:
> Helena wrote:
>> Maybe I am overlooking it but the man
>> page for r.watershed does not say what units
>> the option "flow" should be in - I am guessing it is
>> fraction of 1 (or percent given as decimal - e.g. 50% will
>> be 0.5)
>>
>> so should flow amount  read as fraction or something
>> like that, so that if all rainfall turns to runoff = 1
>> only 50% rainfall turns to runoff (rest is captured by
>> vegetation or infiltrates) = 0.5
>
> I don't think so, it seems to be reading the map as CELL, so
> giving it input data in the range of 0.0-1.0 would be binary.

>From the manual:
"Overland flow units represent the amount of overland flow each cell
contributes to surface flow. If omitted, a value of one (1) is
assumed."

Therefore I think that Helena is right, but there is a bug in
r.watershed because any given input flow map is read as CELL, probably
because accumulation was of type CELL before MFD came in. For MFD,
accumulation must be floating point, so it was changed to DCELL
(probably too much precision, FCELL should do as in r.terraflow).
Changing r.watershed in order to read flow as DCELL seems IMHO
appropriate and would be a small fix.

BTW, an input flow map could be used to determine where water or some
other liquid is distributed to by setting flow to 100 for selected
start points e.g. houses and zero otherwise. Running r.watershed with
MFD would give as accumulation output percentage distributed from
start point (in this example always 100 for SFD), assuming that
nothing is lost by infiltration, evaporation etc.

Markus M

>
>
> ram/init_vars.c
>
> /* read flow accumulation from input map flow: amount of overland flow per cell */
>
>  opened with
> G_open_cell_old(run_name, "")
>  read with
> G_get_c_raster_row()
>  into
> G_allocate_cell_buf()
>
> value set as
>   wat[SEG_INDEX(wat_seg, r, c)] = buf[c];
>
>
> after that I lose track of what it does.. maybe it is setting up
> initial conditions??
>
>
>> should some explanation go into manual?
>
> once we know the answer, sure :)
>
>
>
> Hamish
>
>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>


More information about the grass-dev mailing list