Flow Direction

Creates a raster of flow direction from each cell to its steepest downslope neighbor.

Learn more about how Flow Direction works


Illustration

Flow Direction illustration

Usage tips

Command line and Scripting

Map Algebra

ArcObjects

Syntax

FlowDirection_sa (in_surface_raster, out_flow_direction_raster, force_flow, out_drop_raster)
Parameter Explanation Datatype
Input surface raster (Required)

The input raster representing a continuous surface.

Composite Geodataset
Output flow direction raster (Required)

The output raster that shows the flow direction from each cell to its steepest downslope neighbor.

Raster Dataset
Force all edge cells to flow outward (Optional)

Specifies if edge cells will always flow outward or follow normal flow rules.

  • NORMAL — If the maximum drop on the inside of an edge cell is greater than zero, the flow direction will be determined as usual; otherwise, the flow direction will be toward the edge. Cells that should flow from the edge of the surface raster inward will do so.

  • FORCE — All cells at the edge of the surface raster will flow outward from the surface raster.

Boolean
Output drop raster (Optional)

An optional output drop raster.

The drop raster shows the ratio of the maximum change in elevation from each cell along the direction of flow to the path length between centers of cells, expressed in percentages.

Raster Dataset
Data types for geoprocessing tool parameters

Script Example

# FlowDirection_sample.py
# Description: 
#   Creates a raster of flow direction from each cell to its
#   steepest downslope neighbor.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005

# Import system modules
import arcgisscripting

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

try:
    # Set local variables
    InSurfaceRaster = "C:/data/filleddem"
    OutFlowDirectionRaster = "C:/data/flowdir"
    InFlowDirOption = "NORMAL"    

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

    # Process: FlowDirection
    gp.FlowDirection_sa(InSurfaceRaster, OutFlowDirectionRaster, InFlowDirOption)

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

Map Algebra syntax

FlowDirection(<surface_grid>, {o_drop_grid}, {NORMAL | FORCE})

Parameter Explanation
<surface_grid> A raster representing an elevation surface.
{o_drop_grid} An optional output raster showing a ratio of the maximum change in elevation from each cell along the direction of flow to the path length between centers of cells, expressed in percentages.
{NORMAL | FORCE} Controls the direction of flow at the edges of the surface raster.
  • NORMAL — If the maximum drop on the inside of an edge cell is greater than zero, the flow direction will be determined as usual; otherwise, the flow direction will be toward the edge. Cells that should flow from the edge of the surface raster inward will do so.
  • FORCE — All cells at the edge of the surface raster will flow outward from the surface raster.

Map Algebra example

flowdirection(elev)
flowdirection(elev, drop, force)

ArcObjects syntax

IHydrologyOp::FlowDirection (surfaceRaster As IGeoDataset, createDrop As Boolean, forceFlowAtEdge As Boolean) As IGeoDataset

Parameter Explanation
surfaceRaster A raster representing an elevation surface.
createDrop If the Boolean expression is set to True, an optional output raster will be created showing a ratio of the maximum change in elevation from each cell along the direction of flow to the path length between centers of cells, expressed in percentages.
forceFlowAtEdge Controls the direction of flow at the edges of the surface raster. If the Boolean expression is set to True and the maximum drop on the inside of an edge cell is greater than zero, the flow direction will be determined as usual; otherwise, the flow direction will be toward the edge. Cells that should flow from the edge of the surface raster inward will do so. If set to False, all cells at the edge of the surface will flow outward from the surface.

ArcObjects example

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

' Declare the input surface raster object
Dim pSurfaceDataset As IGeoDataset

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

' Declare the output raster object
Dim pOutputRaster As IGeoDataset

' Calls the method
Set pOutputRaster = pHydrologyOp.FlowDirection (pSurfaceDataset, True, True)

See Also

  • Flow Accumulation
  • Flow Length
  • Sink
  • An overview of the Hydrology tools