Skip To Content

Stream Link

Summary

Assigns unique values to sections of a raster linear network between intersections.

Illustration

Stream Link tool illustration

Usage

  • Links are the sections of a stream channel connecting two successive junctions, a junction and the outlet, or a junction and the drainage divide.

  • The input stream raster can be created by thresholding the results of the Flow Accumulation tool.

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

Syntax

StreamLink_ra (inputStreamRaster, inputFlowDirectionRaster, outputName)
ParameterExplanationData Type
inputStreamRaster

An input raster that represents a linear stream network.

Raster Layer; Image Service; String
inputFlowDirectionRaster

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

Raster Layer; Image Service; String
outputName

The name of the output stream link raster service.

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

String

Code sample

StreamLink example 1 (Python window)

This example assigns unique values to sections of a raster linear network between intersections.

import arcpy
arcpy.StreamLink_ra("https://myserver/rest/services/streams/ImageServer","https://myserver/rest/services/flowdir/ImageServer","outStreamLink1")
StreamLink example 2 (stand-alone script)

This example assigns unique values to sections of a raster linear network between intersections.

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

# Import system modules
import arcpy

# Set local variables
inStreams = "https://myserver/rest/services/streams/ImageServer"
inFlowDirection = "https://myserver/rest/services/flowdir/ImageServer"
outputStreamLink = "outStreamLink2"

# Execute Stream Link raster analysis tool
arcpy.StreamLink_ra(inStreams, inFlowDirection, outputStreamLink)

Licensing information

  • ArcGIS Desktop Basic: Requires ArcGIS Image Server
  • ArcGIS Desktop Standard: Requires ArcGIS Image Server
  • ArcGIS Desktop Advanced: Requires ArcGIS Image Server

Related topics