Flow Accumulation (Spatial Analyst)

License Level:BasicStandardAdvanced

Summary

Creates a raster of accumulated flow into each cell. A weight factor can optionally be applied.

Learn more about how Flow Accumulation works

Illustration

Flow Accumulation illustration
Flow_Acc = FlowAccumulation(Flow_Dir)

Usage

Syntax

FlowAccumulation (in_flow_direction_raster, {in_weight_raster}, {data_type})
ParameterExplanationData Type
in_flow_direction_raster

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

The flow direction raster can be created using the Flow Direction tool.

Raster Layer
in_weight_raster
(Optional)

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

If no weight raster is specified, a default weight of 1 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.

Raster Layer
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.
String

Return Value

NameExplanationData Type
out_accumulation_raster

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

Raster

Code Sample

FlowAccumulation example 1 (Python window)

This example creates a raster of accumulated flow into each cell of an input flow direction GRID raster.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outFlowAccumulation = FlowAccumulation("flowdir")
outFlowAccumulation.save("C:/sapyexamples/output/outflowacc01")
FlowAccumulation example 2 (stand-alone script)

This example creates a raster of accumulated flow into each cell of an input flow direction IMG raster.

# Name: FlowAccumulation_Ex_02.py
# Description: Creates a raster of accumulated flow to each cell.
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inFlowDirRaster = "flowdir"
inWeightRaster = ""
dataType = "INTEGER"

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute FlowDirection
outFlowAccumulation = FlowAccumulation(inFlowDirRaster, inWeightRaster, dataType)

# Save the output 
outFlowAccumulation.save("C:/sapyexamples/output/outflowacc02.img")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires Spatial Analyst
ArcGIS for Desktop Standard: Requires Spatial Analyst
ArcGIS for Desktop Advanced: Requires Spatial Analyst
11/8/2012