ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Focal Flow

Available with Spatial Analyst license.

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

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

  • Focal Flow evaluates the eight immediate neighbors of a cell to determine the flow.

  • The resulting values from the tool measure flow into, not out of, a cell.

  • The output values are derived from the binary representation of the results of the analysis.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

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

  • Auto Commit
  • Cell Size
  • Compression
  • Current Workspace
  • Extent
  • Geographic Transformations
  • Mask
  • Output CONFIG Keyword
  • Output Coordinate System
  • Raster Statistics
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing Information

  • ArcGIS for Desktop Basic: Requires Spatial Analyst
  • ArcGIS for Desktop Standard: Requires Spatial Analyst
  • ArcGIS for Desktop Advanced: Requires Spatial Analyst

Related Topics

  • An overview of the Neighborhood toolset
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal