Converts a raster representing a linear network to features representing the linear network.
Learn more about how Stream to Feature works
Usage tips
Command line and Scripting
-
The results of the Flow Accumulation function can be used to create a raster stream network by applying a threshold value to select cells with a high accumulated flow. For example, cells that have more than 100 cells flowing into them are used to define the stream network. Use the Con or Set Null function to create a stream network raster where flow accumulation values of 100 or greater go to one, and the remainder are put to the background (NoData). The resulting stream network can be used in Stream Link and Stream to Feature. An analytical method for determining an appropriate threshold value for stream network delineation is presented in Tarboton et al. (1991).
ArcObjects
-
The raster linear network should be represented as valid values on a background of NoData. There should be contiguous features with the same value, such as the result of the StreamOrder or StreamLink function. StreamShape should not be used on a raster where there are few adjacent cells of the same value.
StreamToFeature_sa (in_stream_raster, in_flow_direction_raster, out_polyline_features, simplify)
| Parameter |
Explanation |
Datatype |
| Input stream raster (Required) |
An input raster that represents a linear stream network.
|
Composite Geodataset |
| Input flow direction raster (Required) |
The input raster that records the direction of flow out of each cell.
This can be created with the Flow Direction function.
|
Composite Geodataset |
| Output polyline features (Required) |
Output feature class that will hold the converted streams.
|
Feature Class |
| Simplify polylines (Optional) |
Specifies whether weeding is used.
- SIMPLIFY — The feature is weeded to reduce the number of vertices. The Douglas-Puecker algorithm for line generalization is used, with a tolerance of sqrt(0.5) * cell size.
- NO_SIMPLIFY — No weeding is applied.
By default, weeding is applied.
|
Boolean |
Data types for geoprocessing tool parametersScript Example
# StreamToFeature_sample.py
# Description:
# Converts a raster representing a linear network to features
# representing the linear network. Requirements: None
# Author: ESRI
# Date: Sept 6, 2005
# Import system modules
import arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
try:
# Set local variables
InStreamRaster = "C:/data/stream"
InFlowDirectionRaster = "C:/data/flowdir"
OutPolylineFeatures = "C:/data/streamfeature.shp"
InGeneralizeOption = "NO_SIMPLIFY"
# Check out Spatial Analyst extension license
gp.CheckOutExtension("Spatial")
# Process: StreamToFeature
gp.StreamToFeature_sa(InStreamRaster, InFlowDirectionRaster, OutPolylineFeatures, InGeneralizeOption)
except:
# If an error occurred while running a tool, then print the messages.
print gp.GetMessages()
IHydrologyOp::StreamToFeature (streamRaster As IGeoDataset, directionRaster As IGeoDataset, performWeeding as Boolean) As IGeoDataset
| Parameter |
Explanation |
| streamRaster |
An input Raster, RasterDataset, RasterBand, or RasterDescriptor representing a linear stream network. |
| directionRaster |
An input Raster, RasterDataset, RasterBand, or RasterDescriptor showing the direction of flow out of each cell.
This can be created using the IHydrologyOp::FlowDirection method. |
| performWeeding |
A Boolean that indicates whether weeding will be performed.
The default is False, so weeding is not applied. |
ArcObjects example
' Create the RasterHydrologyOp object
Dim pHydrologyOp As IHydrologyOp
Set pHydrologyOp = New RasterHydrologyOp
' Declare the input stream raster object
Dim pInputStream As IGeoDataset
' Calls function to open a raster dataset from disk
Set pInputStream = OpenRasterDataset ("D:\SpatialData", "inputstream")
' Declare the input direction raster object
Dim pDirection As IGeoDataset
' Calls function to open a raster dataset from disk
Set pDirection = OpenRasterDataset ("D:\SpatialData", "direction")
' Declare the output raster object
Dim pOutputRaster As IGeoDataset
' Calls the method
Set pOutputRaster = pHydrologyOp.StreamToFeature (pInputStream, pDirection, True)