Summary
Assigns unique values to the parts of a grid-line network between junctions.
Usage
· "Connection" means the section of a river that connects two adjacent junctions, connects to a junction and outlet, or joins a junction and watershed.
· The input stream raster data can be created by setting thresholds for the results of the traffic tool.
· On the background of NoData, the stream grid line network should be represented as a value greater than or equal to one.
Grammar
Streamlink (In_stream_raster, In_flow_direction_raster)
Code instance
Streamlink Example 1 (Python window)
This example assigns a unique value to each part of the grid-line network between junctions.
Import arcpy
From arcpy Import env
From ARCPY.SA Import *
Env.workspace = "C:/sapyexamples/data"
Outstreamlink = Streamlink ("Stream", "Flowdir")
Outstreamlink.save ("C:/sapyexamples/output/outstrmlnk01")
Streamlink Example 2 (stand-alone script)
This example assigns a unique value to each part of the grid-line network between junctions.
# 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
Instreamraster = "Stream"
Inflowdirection = "Flowdir"
# Check out the ArcGIS Spatial Analyst extension License
arcpy. Checkoutextension ("Spatial")
# Execute Streamlink
Outstreamlink = Streamlink (Instreamraster, inflowdirection)
# Save the output
Outstreamlink.save ("c:/sapyexamples/output/outstrmlnk02")
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
ArcGIS Tutorial: Stream connections