Stream Order (Spatial Analyst)

Summary

Assigns a numeric order to segments of a raster representing branches of a linear network.

Learn more about how Stream Order works

Usage

Syntax

StreamOrder (in_stream_raster, in_flow_direction_raster, {order_method})
ParameterExplanationData Type
in_stream_raster

An input raster that represents a linear stream network.

The input stream raster linear network should be represented as values greater than or equal to one on a background of NoData.

Raster Layer
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
order_method
(Optional)

The method used for assigning stream order.

  • STRAHLER The method of stream ordering proposed by Strahler in 1952. Stream order only increases when streams of the same order intersect. Therefore, the intersection of a first-order and second-order link will remain a second-order link, rather than creating a third-order link. This is the default.
  • SHREVE The method of stream ordering by magnitude, proposed by Shreve in 1967. All links with no tributaries are assigned a magnitude (order) of one. Magnitudes are additive downslope. When two links intersect, their magnitudes are added and assigned to the downslope link.
String

Return Value

NameExplanationData Type
out_raster

The output stream order raster.

It will be of integer type.

Raster

Code Sample

StreamOrder example 1 (Python window)

This example assigns a numeric order to segments of a raster representing branches of a linear network.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outStreamOrder = StreamOrder("stream", "flowdir", "STRAHLER")
outStreamOrder.save("c:/sapyexamples/output/outstrmordr01")
StreamOrder example 2 (stand-alone script)

This example assigns a numeric order to segments of a raster representing branches of a linear network.

# Name: StreamOrder_Ex_02.py
# Description: Assigns a numeric order to segments of a raster 
#              representing branches of a linear network.
# Requirements: Spatial Analyst Extension
# Author: ESRI

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inStreamRast = "stream"
inFlowDirectionRaster = "flowdir"
orderMethod = "STRAHLER"

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

# Execute StreamOrder
outStreamOrder = StreamOrder(inStreamRast, inFlowDirectionRaster, orderMethod)

# Save the output 
outStreamOrder.save("c:/sapyexamples/output/outstrmordr02")

Environments

Related Topics

Licensing Information

ArcView: Requires Spatial Analyst
ArcEditor: Requires Spatial Analyst
ArcInfo: Requires Spatial Analyst

6/29/2011