You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Hydrology (Spatial Analyst)

# Flow Accumulation

Release 9.2

Print all topics in : "Hydrology (Spatial Analyst)"

Related Topics

Creates a raster of accumulated flow to each cell.

Illustration

Usage tips

Command line and Scripting

• The result of Flow Accumulation is a raster of accumulated flow to each cell, as determined by accumulating the weight for all cells that flow into each downslope cell.

• Cells of undefined flow direction will only receive flow; they will not contribute to any downstream flow. A cell is considered to have an undefined flow direction if its value in the <in_flow_direction_raster> is anything other than 1, 2, 4, 8, 16, 32, 64, or 128.

• The accumulated flow is based on the number of cells flowing into each cell in the output raster. The current processing cell is not considered in this accumulation.

• Output cells with a high flow accumulation are areas of concentrated flow and can be used to identify stream channels.

• Output cells with a flow accumulation of zero are local topographic highs and can be used to identify ridges.

• If the <in_flow_direction_raster> is not created with the FlowDirection command, there is a chance that the defined flow could loop. If the flow direction does loop, Flow Accumulation will go into an infinite loop and never finish.

• Map Algebra

• Cells of undefined flow direction will only receive flow; they will not contribute to any downstream flow. A cell is considered to have an undefined flow direction if its value in the flow direction raster is anything other than 1, 2, 4, 8, 16, 32, 64, or 128.

• The accumulated flow is based on the number of cells flowing into each cell in the output raster. The current processing cell is not considered in this accumulation.

• Output cells with a high flow accumulation are areas of concentrated flow and can be used to identify stream channels.

• Output cells with a flow accumulation of zero are local topographic highs and can be used to identify ridges.

• If the flow direction raster is not created with the FlowDirection command, there is a chance that the defined flow could loop. If the flow direction does loop, the FlowAccumulation command will go into an infinite loop and never finish.

• Learn more about how to specify the input raster dataset in the Map Algebra expression of Raster Calculator.

• ArcObjects

• Cells of undefined flow direction will only receive flow; they will not contribute to any downstream flow. A cell is considered to have an undefined flow direction if its value in the flow direction raster is anything other than 1, 2, 4, 8, 16, 32, 64, or 128.

• The accumulated flow is based on the number of cells flowing into each cell in the output raster. The current processing cell is not considered in this accumulation.

• Output cells with a high flow accumulation are areas of concentrated flow and can be used to identify stream channels.

• Output cells with a flow accumulation of zero are local topographic highs and can be used to identify ridges.

• If the flow direction raster is not created with the FlowDirection method, there is a chance that the defined flow could loop. If the flow direction does loop, the FlowAccumulation method will go into an infinite loop and never finish.

• The output from the FlowAccumulation method is a floating-point raster object.

• The output from the FlowAccumulationInt method is an integer raster object.

Command line syntax
An overview of the Command Line window
FlowAccumulation_sa <in_flow_direction_raster> <out_accumulation_raster> {in_weight_raster} {FLOAT | INTEGER}

 Parameter Explanation Data Type Input flow direction raster. This can be created with the Flow Direction function. Composite Geodataset Output flow accumulation raster dataset. Raster Dataset {in_weight_raster} Weight assigned 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 {FLOAT | INTEGER} 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

### Command line example

`FlowAccumulation_sa C:/data/flowdir C:/data/flowaccu`

Scripting syntax
About getting started with writing geoprocessing scripts
FlowAccumulation_sa (in_flow_direction_raster, out_accumulation_raster, in_weight_raster, data_type)

 Parameter Explanation Data Type in_flow_direction_raster (Required) Input flow direction raster. This can be created with the Flow Direction function. Composite Geodataset out_accumulation_raster (Required) Output flow accumulation raster dataset. Raster Dataset in_weight_raster (Optional) Weight assigned 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 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)```

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.