Q: I have a friction map, a start polygon and an end polygon and would like to find the least cost path, meaning not a corridor but a thin line. Themanual says: "If the input surface (a raster map layer) is a cumulative cost map generated by the or modules, the -d flag and a movement direction surface "indir" must be specified." I assume it's a kind of flow direction or aspect, but what is the physical meaning, and how can I calculate it?
A: The physical meaning is movement direction in degrees CCW from East, similar to e.g. flow direction output of. The direction map is an optional output of and , and should be used with the indir option for .
The workflow would thus be:
- convert the first polygon to a raster map
- use all cells of the first polygon as start points for r.walk, include the friction map
- convert the second polygon to a raster map
- use the second polygon as a MASK and get the coordinates of the cell with the lowest cost
- use these coordinates as start coordinates for r.drain, together with the movement direction map and the cumulative cost map produced by r.drain