Flow Direction (Raster Analysis)

Title  Flow Direction (Raster Analysis)

Summary

Calculates the direction of flow from each cell to its downslope neighbor or neighbors using the D8, D-Infinity (DINF), or Multiple Flow Direction (MFD) method.


Illustration

Flow Direction tool illustration

Usage


Syntax

Parameter Explanation
inputSurfaceRaster

The input raster representing a continuous surface.

outputFlowDirectionName

The name of the output flow direction raster service.

The default name is based on the tool name and the input layer name. If the layer already exists, you will be prompted to provide another name.

forceFlow (Optional)

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

  • Unchecked—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. This is the default.
  • Checked—All cells at the edge of the surface raster will flow outward from the surface raster.
flowDirectionType (Optional)

Specifies the type of flow method to use while computing flow directions.

  • D8—Assign a flow direction based on the D8 flow method. This method assigns flow direction to the steepest downslope neighbor. This is the default.
  • MFD—Assign a flow direction based on the MFD flow method. This method assigns multiple flow directions towards all downslope neighbors.
  • DINF—Assign a flow direction based on the D-Infinity flow method using the steepest slope of a triangular facet.
outputDropName

The name of the output drop raster service.

The default name is based on the tool name and the input layer name. If the layer already exists, you will be prompted to provide another name.

Code Samples

FlowDirection example 1 (Python window)

This example creates a flow direction raster from the input surface raster.


import arcpy
arcpy.FlowDirection_ra("https://myserver/rest/services/elevation/ImageServer","outD8FlowDir1")
                    

FlowDirection example 2 (stand-alone script)

This example creates a flow direction raster from the input surface raster.


#---------------------------------------------------------------------------
# Name: FlowDirection_example02.py
# Requirements: ArcGIS Image Server

# Import system modules
import arcpy

# Set local variables
inSurface = "https://myserver/rest/services/elevation_filled/ImageServer"
outputFlowDirection = "outD8FlowDir2"
forceFlow = "NORMAL"
flowDirectionType = "D8"

# Execute Flow Direction raster analysis tool
arcpy.FlowDirection_ra(inSurface, outputFlowDirection, forceFlow, flowDirectionType)

                    

Tags

Credits

Use limitations