cost path analysis

Jianping Xu jianp at
Tue Apr 13 14:51:29 EDT 1993

> Hello,
> I have been trying to use r.cost to perform a cumulative cost analysis along
> a one cell width road network with no success.
> Has anyone run across a script that would take a starting x,y point and move
> cell by cell along the network summing category values along the way?
> I have tried r.cost with a mask as well as trying to assign high values to
> '0' value areas but it doesn't perform as is described in the manual pages.
> Any suggestions would be appreciated.
> Bill Jackson

Try assigning very high values to 'zero' areas and running it WITHOUT a mask.
(r.cost actually takes '0' values from masked-out areas.) 

If you use r.mapcalc to eliminate the cumulative values in 'zero' value
areas afterwards, you'll get a nice looking cumulative cost map. But
this just works well for the part that connected.

Jianping Xu
Rutgers University

More information about the grass-user mailing list