I have updated the r.walk, r.cost and r.drain modules to include
"back-link raster" functionality. Currently the path created by
r.drain does not necessarily take THE path through a cost surface,
that the cost accumulation algorithm took to generate that cost
surface. My updates add an "outdir" raster as an output from the
r.drain and r.cost modules which creates a backlink raster, or a
raster surface of the movements made to create the cost surface
(recorded in degrees). I then modified r.drain to read this surface
when it's given the "-d" flag.
I have tested it on my win32/vista build (mingw/msys), but not on linux or mac builds. Since this is my first patch, I have added extensive commenting which can probably be removed later.