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

Flow Length

Available with Spatial Analyst license.

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

Summary

Calculates the upstream or downstream distance, or weighted distance, along the flow path for each cell.

Usage

  • A primary use of the Flow Length tool is to calculate the length of the longest flow path within a given basin. This measure is often used to calculate the time of concentration of a basin. This would be done using the UPSTREAM option.

    The tool can also be used to create distance-area diagrams of hypothetical rainfall and runoff events using the weight raster as an impedance to movement downslope.

  • The value type for the Flow Length output raster is floating point.

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

Syntax

FlowLength (in_flow_direction_raster, {direction_measurement}, {in_weight_raster})
ParameterExplanationData Type
in_flow_direction_raster

The input raster that shows the direction of flow out of each cell.

The flow direction raster can be created using the Flow Direction tool.

Raster Layer
direction_measurement
(Optional)

The direction of measurement along the flow path.

  • DOWNSTREAM — Calculates the downslope distance along the flow path, from each cell to a sink or outlet on the edge of the raster.
  • UPSTREAM — Calculates the longest upslope distance along the flow path, from each cell to the top of the drainage divide.
String
in_weight_raster
(Optional)

An optional input raster for applying a weight to each cell.

If no weight raster is specified, a default weight of 1 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.

Raster Layer

Return Value

NameExplanationData Type
out_raster

The output raster that shows for each cell the upstream or downstream distance along a flow path.

Raster

Code Sample

FlowLength example 1 (Python window)

This example Calculates the downstream distance along the flow path for each cell.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outFlowLength = FlowLength("flowdir", "DOWNSTREAM", "")
outFlowLength.save("c:/sapyexamples/output/outflowlen01")
FlowLength example 2 (stand-alone script)

This example Calculates the downstream distance along the flow path for each cell.

# Name: _Ex_02.py
# Description: 
# 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
inFlowDirectionRaster = "flowdir"
inWeightRaster = ""
directionType = "DOWNSTREAM"

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

# Execute 
outFlowLength = FlowLength(inFlowDirectionRaster, directionType, inWeightRaster)

# Save the output 
outFlowLength.save("c:/sapyexamples/output/outflowlen02.tif")

Environments

  • Auto Commit
  • Cell Size
  • Current Workspace
  • Extent
  • Geographic Transformations
  • 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 Hydrology 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