[GRASS-user] negative slope values and movement costs

Glynn Clements glynn at gclements.plus.com
Fri Feb 2 00:50:26 EST 2007

Michael Barton wrote:

> If you are calculating round-trip, simply create a slope map and use the
> original Tobler algorithm to make a positive (i.e. uphill) cost map and a
> negative (downhill) cost map. Then add them together and use the summed
> result as the basis for a round-trip cost surface. If you are doing one-way
> only you¹ll need an anisotropic algorithm. Perhaps you can modify the
> coefficients in r.walk to simulate a Tobler result. If not you can create
> the whole thing in the map calculator (e.g., using neighborhood functions)
> or the best way would be to work with Markus on r.walk to add the Tobler
> algorithm as an option if it is widely used and generally desirable.

You can't implement r.cost/r.walk purely with r.mapcalc, as such an
algorithm is inherently stateful, while r.mapcalc is stateless.

You would probably want to modify r.walk or r.cost. One relatively
simple option would be to modify r.cost to use 8 different cost maps:
one for each of the possible directions (I'm ignoring -k here). You
could generate the cost maps from a DEM using r.mapcalc.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-user mailing list