Focal Flow (Spatial Analyst)

License Level:BasicStandardAdvanced

Summary

Determines the flow of the values in the input raster within each cell's immediate neighborhood.

Learn more about how Focal Flow works

Illustration

Focal Flow illustration
OutRas = FocalFlow(InRas1)

Usage

Syntax

FocalFlow (in_surface_raster, {threshold_value})
ParameterExplanationData Type
in_surface_raster

The input surface raster for which to calculate the focal flow.

The eight immediate neighbors of each cell are evaluated to determine the flow.

The input raster can be integer or floating point.

Raster Layer
threshold_value
(Optional)

Defines a value that constitutes the threshold, which must be equaled or exceeded before flow can occur.

The threshold value can be either an integer or floating-point value.

If the difference between the value at a neighboring cell location and the value of the processing cell is less than or equal to the threshold value, the output will be 0 (or no flow).

Double

Return Value

NameExplanationData Type
out_raster

The output focal flow raster.

The output raster is always of integer type.

Raster

Code Sample

FocalFlow example 1 (Python window)

This example determines the binary representation of flow for the input raster with a threshold value of 10.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
focalFlowOut = FocalFlow("elevation", 10)
focalFlowOut.save("C:/sapyexamples/output/flowout")
FocalFlow example 2 (stand-alone script)

This example determines the binary representation of flow for the input raster with a threshold value of 5.

# Name: FocalFlow_Ex_02.py
# Description: Determines the flow of the values in the 
#    input raster within each cell's immediate neighborhood.
# 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
inRaster = "elevation"
threshold = 5 

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

# Execute FocalFlow
outFocalFlow = FocalFlow(inRaster, threshold)

# Save the output 
outFocalFlow.save("C:/sapyexamples/output/focalflow")

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
4/10/2014