[GRASS-dev] [GRASS GIS] #3468: r.drain: replace with new r.path, support multiple directions
GRASS GIS
trac at osgeo.org
Wed Dec 20 14:41:04 PST 2017
#3468: r.drain: replace with new r.path, support multiple directions
--------------------------+---------------------------------
Reporter: mmetz | Owner: grass-dev@…
Type: enhancement | Status: new
Priority: normal | Milestone: 7.5.0
Component: Raster | Version: svn-releasebranch74
Resolution: | Keywords: r.drain
CPU: All | Platform: All
--------------------------+---------------------------------
Comment (by mmetz):
Replying to [comment:2 wenzeslaus]:
> Replying to [ticket:3468 mmetz]:
[...]
>
> Once r.drain is a script, it would be great if we can manage to also
remove the need for providing a "dummy" cost map. See `r.mapcalc "const1 =
1"` in a r.drain example I created recently (please, correct me if I'm
wrong):
>
> https://grass.osgeo.org/grass74/manuals/r.drain.html#path-following-
directions
Yes, a dummy cost map should not be needed. Either an elevation map or a
direction map is needed. If a direction map is not provided, an elevation
map will be needed to create a direction map with r.fill.dir.
>
> Jenson and Domingue (1988) is a format described in a paper and it makes
sense adding it. Any ideas for a name? The current ones (in r.fill.dir)
are not really descriptive (agnps, answers, grass).
I suggest bitmask as a new name. This name is also not really descriptive
and should be explained in the manual of r.fill.dir. BTW, the manual of
r.fill.dir provides clear explanations of
agnps, answers, grass.
>
> > i.e. r.cost, r.walk, r.watershed, to be used as input for r.path.
>
> One common format for all modules would be great.
Two common formats: 1. degrees CCW from East, 2. bitmask for multiple
directions as described by Jenson and Domingue (1988)
> It is strange when user needs to recompute the angles like in my r.drain
example from above (again, correct me if I'm wrong):
>
> https://grass.osgeo.org/grass74/manuals/r.drain.html#path-following-
directions
That would be a substantial change because other modules (all r.stream.*)
depend on the direction output of r.watershed.
>
> > the least costly path from a single start point to a single stop point
can split and merge repeatedly (see attached multiple-directions-
path.png).
>
> Looks great!
Implemented in r71962 (added r.path) and r71963 (updated r.cost/r.walk).
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3468#comment:3>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list