| Label | Explanation | Data Type |
Input Stream Features | The streamline features that will be adjusted to match the input raster resolution. | Feature Dataset |
Input Raster | The raster the input streamline features will be adjusted to. | Raster Dataset |
Output Adjusted Stream Features | The jagged representation of the input streamline features matching the input raster resolution. The output stream features will be grouped depending on the Group By Field parameter value. In addition to the specified field, if any, the attribute table will also have the following field: StreamLink—An ID assigned to stream links. Links are the sections of a stream channel connecting two successive junctions. | Feature Class |
Group By Field (Optional) | The field that contains the values that will be used to group the streams in the Output Adjusted Stream Features and Output Adjusted Stream Raster parameter values. Values in the field must be integer. | Field |
Remove Sharp Angles (Optional) | Specifies whether sharp angles will be removed from the output stream features. Sharp angles are represented by 90-degree line segments one cell size in width.
| Boolean |
Divergent Flow or Next Path Field (Optional) | The field in the Input Stream Features parameter value that indicates the main channel after a flow split. The stream segment that corresponds to the main channel must be indicated using an ID. The ID must be present and listed in a field named HydroID. | Field |
Output Adjusted Stream Raster (Optional) | The raster version of the Output Adjusted Stream Features parameter value. The cell values correspond to the values in the field specified in the Group By Field parameter value. | Raster Dataset |
Output Flow Direction Raster (Optional) | The raster that will store the flow direction (D8) within the stream cells that match the digitized direction of the input stream features. | Raster Dataset |
Output Split Point Features (Optional) | The locations where flow splits occur and their associated connectivity nodes in the output adjusted stream features. | Feature Class |
Available with Spatial Analyst license.
Summary
Adjusts the stream feature input to match the resolution of an input raster.
Usage
The Output Adjusted Stream Features (out_stream_features in Python) parameter represents the streamline features in the Input Stream Features (in_stream_features in Python) parameter value after being adjusted to match the resolution of the Input Raster (in_raster in Python) parameter value.
The adjustment process ensures that the adjusted streamline crosses every overlapping cell in the Input Raster parameter value at its center while preserving the original streamline path.
The optional Group By Field (group_by_field in Python) parameter value groups stream segments based on the selected field. By default, there is no grouping applied to the Input Stream Features parameter value unless it contains streamlines that have been segmented into different parts but belong to the same stream segment. In this case, they will be merged to ensure that a unique ID is given to each stream segment in the output. If the field values assign a unique ID to each stream segment, there will not be any grouping.
A raster representation of the adjusted streamlines can be saved by specifying the Output Adjusted Stream Raster (out_stream_raster in Python) parameter value.
The optional Group By Field (group_by_field in Python) parameter value determines the cell values in the Output Adjusted Stream Raster parameter value.
The direction of water flow (D8) at each cell for the adjusted streams can be saved by specifying the Output Flow Direction Raster (out_flow_direction_raster in Python) parameter value.
Use the Remove Sharp Angles (remove_sharp_angles in Python) parameter to ensure that there are no one-cell width lines that make 90 degree angles in the Output Adjusted Stream Features parameter value.
If the Input Stream Features (in_stream_features in Python) parameter value is expected to have locations where a stream splits into two and one is considered the main channel, the main channel can be specified through the Divergent Flow or Next Path Field (divergent_flow_or_next_field in Python) parameter. In this case, a field named HydroID must be present in the Input Stream Features (in_stream_features in Python) parameter value attribute table. For a stream that splits into two, the selected field must point to the HydroID of the stream that is considered the main channel.
The maximum number of stream features that the tool can process is 2,147,483,647 (2^31 - 1).
By default, the analysis extent is that of the Input Stream Features (in_stream_features in Python) parameter value.
See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.
Parameters
AdjustStreamToRaster(in_stream_features, in_raster, out_stream_features, {group_by_field}, {remove_sharp_angles}, {divergent_flow_or_next_field}, {out_stream_raster}, {out_flow_direction_raster}, {out_split_point_features})| Name | Explanation | Data Type |
in_stream_features | The streamline features that will be adjusted to match the input raster resolution. | Feature Dataset |
in_raster | The raster the input streamline features will be adjusted to. | Raster Dataset |
out_stream_features | The jagged representation of the input streamline features matching the input raster resolution. The output stream features will be grouped depending on the group_by_field parameter value. In addition to the specified field, if any, the attribute table will also have the following field: StreamLink—An ID assigned to stream links. Links are the sections of a stream channel connecting two successive junctions. | Feature Class |
group_by_field (Optional) | The field that contains the values that will be used to group the streams in the out_stream_features and out_stream_raster parameter values. Values in the field must be integer. | Field |
remove_sharp_angles (Optional) | Specifies whether sharp angles will be removed from the output stream features. Sharp angles are represented by 90-degree line segments one cell size in width.
| Boolean |
divergent_flow_or_next_field (Optional) | The field in the in_stream_features parameter value that indicates the main channel after a flow split. The stream segment that corresponds to the main channel must be indicated using an ID. The ID must be present and listed in a field named HydroID. | Field |
out_stream_raster (Optional) | The raster version of the out_stream_features parameter value. The cell values correspond to the values in the field specified in the group_by_field parameter value. | Raster Dataset |
out_flow_direction_raster (Optional) | The raster that will store the flow direction (D8) within the stream cells that match the digitized direction of the input stream features. | Raster Dataset |
out_split_point_features (Optional) | The locations where flow splits occur and their associated connectivity nodes in the output adjusted stream features. | Feature Class |
Code sample
This example shows how to use AdjustStreamToRaster to generate streamlines without sharp angles that match the resolution of an input raster. By default, the output is not grouped.
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/arcpyexamples/data.gdb"
AdjustStreamToRaster(in_stream_features="streams",
in_raster="elevation",
out_stream_features="out_stream_features",
group_by_field="NONE",
remove_sharp_angles="REMOVE",
divergent_flow_or_next_field="NONE",
out_stream_raster="out_stream_raster",
out_flow_direction_raster="out_stream_flowdir_raster",
out_split_point_features=None
)This example shows how to use AdjustStreamToRaster to generate streamlines without sharp angles that match the resolution of an input raster. By default, the output is not grouped.
# Name: AdjustStreamToRaster_standalone.py
# Description: Adjust the input streams features to the resolution of the input raster.
# No groupping specified, therefore, the result will have as many number of features as
# there are stream segments.
# Requirements: Spatial Analyst Extension
# Import system modules
import arcpy
from arcpy.sa import *
# Set environment settings
arcpy.env.workspace = "C:/sapyexamples/data"
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Set local variables
InStreamFeatures="streams.shp"
InRaster = "elevation.tif"
OutStreamFeatures = "out_adjusted_streams.shp"
OutStreamRaster = "out_adjusted_streams.tif"
OutFlowDirRaster = "out_streams_fdr.tif"
# Execute the tool
AdjustStreamToRaster(InStreamFeatures,
InRaster,
OutStreamFeatures,
"NONE",
"",
"NONE",
OutStreamRaster,
OutFlowDirRaster,
"")Environments
Licensing information
- Basic: Requires Spatial Analyst
- Standard: Requires Spatial Analyst
- Advanced: Requires Spatial Analyst