[GRASS-user] r.mapcalc & neighborhood modifiers

Markus Neteler neteler at osgeo.org
Fri Apr 29 00:17:58 PDT 2016


Hi Ken,

On Apr 6, 2016 6:29 PM, "Ken Mankoff" <mankoff at gmail.com> wrote:
...
> Now, I'd like to do something similar, which is route all stream water 1
grid cell downstream. I can't figure out how to do this. Perhaps this is
beyond the ability of r.mapcalc, or reasonable bash scripting? Hopefully
someone here can suggest a way to do this in grass.
>
> I think the limitation is that I can't use neighborhood modifiers on the
LHS of an r.mapcalc equation like this:
>
> r.mapcalc "down[${r},${c}] = if(fdir == ${dir}, up, down)"
>
> Which means I need to know the upstream cell, which is information I do
not have. Looping through and finding the upstream cell(s) is non-trivial
because there are likely to be multiple, whereas I know there is only 1
downstream cell because I ran r.watershed with "-s".
...

Would the eval() function of r.mapcalc be of use? In order to hold the
interim values? Just guessing, I did not study your need in details.

Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20160429/5cb67a4e/attachment.html>


More information about the grass-user mailing list