Dear all,

In an r.mapcalc expression, I would like to trace values along a direction map 
for 1 to n steps (e.g. looking 4 steps ahead along a path or stream or along a 
given direction (degrees or 45degrees).

I tried using the neighborhood modifier within an eval function in r.mapcalc. 
Unfortunately, using this command:
r.mapcalc --o << EOF
eval(elev_200 = elevation[1,1] - 200, elev_5 = 5 * elev_200[1,1], elev_p = 
pow(elev_5, 2))
gradient_1 = (0.5 * elev_200) + 0.8 * elev_p
EOF

I get the following error message:
syntax error, unexpected '[', expecting ')'

However, this command works fine:
r.mapcalc --o << EOF
eval(elev_200 = elevation[1,1] - 200, elev_5 = 5 * elevation[1,1], elev_p = 
pow(elev_5, 2))
gradient_1 = (0.5 * elev_200) + 0.8 * elev_p
EOF

My questions now are:
a) is it generally not supported to use the neighbourhood modifier on a 
temporary map defined in an eval() function in r.mapcalc?
b) are there other (efficient) approaches for those of us who do not know C 
(e.g. pygrass)?

I am grateful for any hint.

Kind regards,
Stefan
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to