r.watershed doesnt consider longer distance to diagonal neighbouring pixels
|Reported by:||aread||Owned by:|
When using r.watershed on a low relief smooth dem I realised that the flow direction surface was almost 20 times more likely to go to one of the diagonal pixels rather then the edge pixels. I’m sure this is not right as I interpret the description in Ehlschlaeger (1989) this shouldn’t happen.
The defect is that r.watershed isn’t correcting for the larger distance between cells that share a corner then cells that share an edge. The result is that r.watershed is directing flow to the lowest cell not the steepest cell.
Ehlschlaeger (1989) in the last paragraph of section 4 describes how the search algorithm should be adjusted to account for diagonal cells being further away so that flow follows the steepest path. see http://chuck.ehlschlaeger.info/older/IGIS/paper.html
In http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.watershed/ram/do_astar.c#L232 there is code in get_slope that accounts for the diagonal but it doesn’t seem to be called.