I am looking to calculate flow accumulation from a flow direction raster. In ArcGIS there is Flow Accumulation (http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/flow-accumulation.htm), that seems to do the job. However, I am looking something in opensource software, but all that I have found require using a DEM.

Any function in GRASS or SAGA?

  • 2
    You might also want to look into Whitebox-GAT Hydrological Tools | Flow Accumulation | D8 and Rho8 Flow Accumulation and other tools. (Flow direction = Flow Pointer). – Kazuhito Apr 25 '18 at 16:34
  • I only know that r.water.outlet requires only the flow direction raster, but using it to produce an accumulated map seems a terrible iteration approach on each cell – Marco Apr 25 '18 at 16:40
  • 2
    I would certainly recommend using Whitebox Geospatial analysis Tools for this. It D8 Flow Accumulation and D-infinity Flow Accumulation tools both take flow direction rasters as inputs. Note, however, that the pointer ordering of a Whitebox D8 flow direction raster is slightly different than ArcGIS, and so a reclass operation might be required beforehand. – WhiteboxDev Apr 26 '18 at 11:24
  • Thanks! Effectively, Whitebox has a tool to calculate flow accumulation with only flow direction. Dou you know if there is an option to include a weight raster? – Guido A. Herrera Apr 26 '18 at 12:59
  • For a GRASS GIS solution, see below – markusN Jun 24 '18 at 9:07

The following is a step-by-step process for how to take an ArcGIS D8 flow direction raster and use it to perform a D8 flow accumulation operation in Whitebox Geospatial Analysis Tools. I will preface this by saying that it would obviously be much easier if you had the original DEM from which the flow direction raster was derived. Also, I'm making the assumption that your flow direction raster was derived using the D8 flow algorithm and that it was derived using the ArcGIS flow pointer scheme.

  1. The first step is getting your flow direction raster from ArcGIS into Whitebox GAT. There are several ways to do this, but I recommend using the Raster to Float tool in ArcGIS to convert your raster into a .flt file. This is one of the most efficient formats for getting data into Whitebox GAT. Next, open Whitebox GAT and add the layer to the map. A pop-up window will appear asking if you'd like to convert the raster to Whitebox format, and you simply need to click 'yes'.

  2. The ArcGIS D8 flow direction raster uses the following scheme:

enter image description here

Which is different than Whitebox GAT's:

enter image description here

So you need to use the Reclass tool to convert the pointer values:

enter image description here

  1. Now all you need to do is enter your new flow direction raster as the input D8 flow pointer raster file in the D8 and Rho8 Flow Accumulation tool.

enter image description here

As for your question about the weight raster, you might want to take a look at the D8 Mass Flux tool, which allows for a weight (loading) file and two types of losses (efficiency, which is a proportional loss, and absorption, which is a loss amount).

enter image description here


A new GRASS addon r.accumulate is available. This module only requires a flow direction map to calculate weighted flow accumulation.

If you have a drainage map from r.watershed,

r.accumulate direction=drain_directions accumulation=flow_accum

or using its GUI,

r.accumulate GUI

In this example, the yellow arrows and color-coded numbers show flow directions and accumulation, respectively.

r.accumulate NC example

Optionally, you can perform weighted flow accumulation using the weight option.

r.accumulate direction=drain_directions accumulation=flow_accum weight=flow_weight

If you have a FDR map (FDR.TIF for example) from ArcHydro or ArcGIS,

# import ArcHydro FDR
r.in.gdal input=FDR.TIF output=fdr

# convert FDR to drainage
r.mapcalc expression="drain_directions=int(8-log(fdr,2))"

# calculate accumulation
r.accumulate direction=drain_directions accumulation=flow_accum

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.