R.cost.full from the GRASS algorithm calculates an accumulated cost surface (i.e. a map of travel costs) for a unit cost layer/friction map. The output is a raster map where each grid cell has a value that represents the costs for getting to the closest source (e.g. the next town). Is there a possibility to extract which town is the closest source of each grid cell?
My intention is to get a second raster that contains the closest source (town) for all grid cells.
The manual states that by setting the parameter:
outdir=name I can create a raster
to contain movement directions. However this is not what I exactly need.