<div dir="ltr"><div><br><br>On Mon, Jun 19, 2017 at 10:35 PM, Ken Mankoff <<a href="mailto:mankoff@gmail.com">mankoff@gmail.com</a>> wrote:<br>><br>><br>> On 2017-06-19 at 18:20, Stefan Blumentrath <<a href="mailto:Stefan.Blumentrath@nina.no">Stefan.Blumentrath@nina.no</a>> wrote:<br>> > To my knowledge r.watershed does not require to fill sinks in advance,<br>> > because it has a minimal impact routing for handling (non-real) sinks.<br>> ><br>> > Do you have a particular reason for your wish to fill the DEM in<br>> > advance?<br>><br>> 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.<br><br></div>You don't need to fill sinks with r.watershed, internal sinks are by default drained. You could also use r.hydrodem to remove internal sinks.<br><div><br>> My solution is to fill them like this:<br>><br>> # run the filling algorithm until there are no holes left<br>> A=1<br>> while [[ $A -ne 0 ]]; do<br>>   r.fill.dir input=phi output=phi format=agnps direction=d areas=a --o --q<br>>   A=$(<a href="http://r.info">r.info</a> a | egrep -o "max = .*" | cut -c7-20)<br>> done<br>> g.remove -f type=raster name=a,d<br>><br>> 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.<br><br></div><div>You can create flat areas (also with r.terraflow), then use the -b flag of r.watershed to create a gentle slope for flat areas.<br></div><div><br></div><div>Markus M<br><br></div><div>><br>>   -k.<br>> _______________________________________________<br>> grass-user mailing list<br>> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br><br></div></div>