[GRASS-user] Filling sinks w/ minimum slope

Ken Mankoff mankoff at gmail.com
Mon Jun 19 13:35:06 PDT 2017


On 2017-06-19 at 18:20, Stefan Blumentrath <Stefan.Blumentrath at nina.no> wrote:
> To my knowledge r.watershed does not require to fill sinks in advance,
> because it has a minimal impact routing for handling (non-real) sinks.
>
> Do you have a particular reason for your wish to fill the DEM in
> advance?

If I don't fill it, then my definition of non-real and the algorithms definition are different. I need all water to leave the domain, but there are internal sinks. My solution is to fill them like this:

# run the filling algorithm until there are no holes left
A=1
while [[ $A -ne 0 ]]; do
  r.fill.dir input=phi output=phi format=agnps direction=d areas=a --o --q
  A=$(r.info a | egrep -o "max = .*" | cut -c7-20)
done
g.remove -f type=raster name=a,d

Then use "phi" as the elevation input to r.watershed. Then all water leaves the domain, but there are flat areas. I would prefer if these were gently-sloped. A colleague does this in QGIS w/ SAGA and the minimum slope, but I am trying to make the work reproducible, and therefore prefer CLI GRASS to GUI QGIS.

  -k.


More information about the grass-user mailing list