[GRASS-dev] [GRASS GIS] #3468: r.drain: replace with new r.path, support multiple directions

GRASS GIS trac at osgeo.org
Wed Dec 20 02:07:18 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 mlennert):

 Replying to [ticket:3468 mmetz]:
 > r.drain is a clone of r.fill.dir, with the added functionality to
 extract a path from a given start point to the nearest outlet, using
 internally calculated directions. Later on, the option to supply a
 direction map was added in order to support output from r.cost, r.walk,
 and r.watershed. This code duplication should be avoided. A new module
 r.path could be added that uses a direction map with optional surface map
 to trace paths. r.drain could then be converted to a script calling
 r.path. If no direction map is supplied, r.fill.dir can be used by r.drain
 to create a direction map.

 +1

 >
 > r.fill.dir uses a bitmask to encode multiple directions from a single
 cell, as described by Jenson and Domingue (1988). These multiple
 directions are internally resolved to find the main (single) flow
 direction which is then recoded to a standard direction format using
 degrees. This bitmask to encode multiple directions from a single cell
 could be used and exposed by various other modules, i.e. r.cost, r.walk,
 r.watershed, to be used as input for r.path. As a result, 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).

 +1

 ;-)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3468#comment:1>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list