Flow Accumulation

Creates a raster of accumulated flow to each cell.

Learn more about how Flow Accumulation works


Illustration

Flow Accumulation illustratio

Usage tips

Command line and Scripting

Map Algebra

ArcObjects

Syntax

FlowAccumulation_sa (in_flow_direction_raster, out_accumulation_raster, in_weight_raster, data_type)
Parameter Explanation Datatype
Input flow direction raster (Required)

The input raster that records the direction of flow out of each cell.

This can be created with the Flow Direction function.

Composite Geodataset
Output accumulation raster (Required)

The output raster that shows the accumulated flow to each cell.

Raster Dataset
Input weight raster (Optional)

An optional input raster for applying a weight to each cell.

If no {in_weight_raster} is specified, a default weight of one will be applied to each cell. For each cell in the output raster, the result will be the number of cells that flow into it.

Composite Geodataset
Data type (Optional)

The output accumulation raster can be integer or floating point type.

  • FLOAT — The output raster will be floating point type. This is the default.

  • INTEGER — The output raster will be integer type.

boolean
Data types for geoprocessing tool parameters

Script Example

# FlowAccumulation_sample.py
# Description: 
#   Creates a raster of accumulated flow to each cell.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables
    InFlowDirectionRaster = "C:/data/flowdir"
    OutAccumulationRaster = "C:/data/flowaccu"

     # Check out Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Process: FlowAccumulation
    gp.FlowAccumulation_sa(InFlowDirectionRaster, OutAccumulationRaster)

except:
    # If an error occurred while running a tool, then print the messages.
    print gp.GetMessages()

Map Algebra syntax

FlowAccumulation(<dir_grid>, {weight_grid})

Parameter Explanation
<dir_grid> A raster showing direction of flow out of each cell. This can be created using the FlowDirection function.
{weight_grid} The weight assigned to each cell. If no {weight_grid} is specified, a default weight of one will be applied to each cell. For each cell in the output raster, the result will be the number of cells that flow into it.

Map Algebra example

flowaccumulation(flowdir)
flowaccumulation(flowdir, rainfall)
flowaccumulation(flowdirection(elev), rainfall)

ArcObjects syntax

IHydrologyOp::FlowAccumulation (directionRaster As IGeoDataset, [weightRaster As Variant]) As IGeoDataset

IHydrologyOp::FlowAccumulationInt (directionRaster As IGeoDataset, [weightRaster]) As IGeoDataset

Note: The output raster of FlowAccumulation is of Floating Point type. The output of FlowAccumulationInt is of Integer type. FlowAccumulationInt is a member of esriSpatialAnalyst.IHydrologyOp2.

Parameter Explanation
directionRaster A raster showing direction of flow out of each cell. This can be created using the IHydrologyOp::FlowDirection method.
[weightRaster] The weight assigned to each cell. If no [weightRaster] is specified, a default weight of one will be applied to each cell. For each cell in the output, the result will be the number of cells that flow into it. The data type for the weightRaster can be any Raster object that supports IGeoDataset (for example, Raster, Raster band, and so on).

ArcObjects example

' Create the RasterHydrologyOp object
Dim pHydrologyOp As IHydrologyOp
Set pHydrologyOp = New RasterHydrologyOp

' Declare the input direction raster object
Dim pDirectionDataset As IGeoDataset

' Calls function to open a raster dataset from disk
Set pDirectionDataset = OpenRasterDataset("D:\SpatialData", "directionraster")

' Declare the output raster object
Dim pOutputRaster As IGeoDataset

' Calls the method
Set pOutputRaster = pHydrologyOp.FlowAccumulation(pDirectionDataset)

See Also

  • Flow Direction
  • Flow Length
  • Snap Pour Point
  • An overview of the Hydrology tools