Stream to Feature (Spatial Analyst)

Summary

Converts a raster representing a linear network to features representing the linear network.

Learn more about how Stream to Feature works

Usage

Syntax

StreamToFeature (in_stream_raster, in_flow_direction_raster, out_polyline_features, {simplify})
ParameterExplanationData Type
in_stream_raster

An input raster that represents a linear stream network.

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
out_polyline_features

Output feature class that will hold the converted streams.

Feature Class
simplify
(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

Code Sample

StreamToFeature example 1 (Python window)

This example converts a raster representing a linear network to features.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
StreamToFeature("stream", "flowdir", "c:/sapyexamples/output/outstrm01.shp", 
                "NO_SIMPLIFY")
StreamToFeature example 2 (stand-alone script)

This example converts a raster representing a linear network to features.

# Name: _Ex_02.py
# Description: 
# 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
inStreamRaster = "stream"
inFlowDir = "flowdir"
outStreamFeats = "c:/sapyexamples/output.gdb/outstrm02"


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

# Execute 
StreamToFeature(inStreamRaster, inFlowDir, outStreamFeats,
                 "NO_SIMPLIFY")

Environments

Related Topics

Licensing Information

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

6/29/2011