Hi Ken, On Apr 6, 2016 6:29 PM, "Ken Mankoff" <mank...@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
_______________________________________________ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user