<p dir="ltr">Hi Ken,<br></p>
<p dir="ltr">On Apr 6, 2016 6:29 PM, "Ken Mankoff" <<a href="mailto:mankoff@gmail.com">mankoff@gmail.com</a>> wrote:<br>
...<br>
> 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.<br>
><br>
> I think the limitation is that I can't use neighborhood modifiers on the LHS of an r.mapcalc equation like this:<br>
><br>
> r.mapcalc "down[${r},${c}] = if(fdir == ${dir}, up, down)"<br>
><br>
> 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".<br>
...</p>
<p dir="ltr">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.</p>
<p dir="ltr">Markus<br>
</p>