ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Stream to Feature

Available with Spatial Analyst license.

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

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

Learn more about how Stream to Feature works

Usage

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

  • The results of the Flow Accumulation tool 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 tool 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.

  • There should be contiguous features with the same value, such as the results of the Stream Order or Stream Link tool. Stream to Feature should not be used on a raster in which there are few adjacent cells of the same value.

  • The direction of the output features will point downstream.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

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

# 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

  • Auto Commit
  • Current Workspace
  • Default Output Z Value
  • Extent
  • Geographic Transformations
  • Mask
  • M Resolution
  • M Tolerance
  • Maintain Spatial Index
  • Output CONFIG Keyword
  • Output Coordinate System
  • Output has M values
  • Output has Z values
  • Output M Domain
  • Output XY Domain
  • Output Z Domain
  • Scratch Workspace
  • Snap Raster
  • XY Resolution
  • XY Tolerance
  • Z Resolution
  • Z Tolerance

Licensing Information

  • ArcGIS for Desktop Basic: Requires Spatial Analyst
  • ArcGIS for Desktop Standard: Requires Spatial Analyst
  • ArcGIS for Desktop Advanced: Requires Spatial Analyst

Related Topics

  • An overview of the Hydrology toolset
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal