Show Navigation | Hide Navigation
You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Hydrology (Spatial Analyst)

Flow Accumulation

Release 9.2
Last modified January 3, 2008
E-mail This Topic Printable Version Give Us Feedback

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


Related Topics

Creates a raster of accumulated flow to each cell.

Learn more about how Flow Accumulation works


Illustration

Flow Accumulation illustration

Usage tips

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
<in_flow_direction_raster>

Input flow direction raster.

This can be created with the Flow Direction function.

Composite Geodataset
<out_accumulation_raster>

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
<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)

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.