This tool performs common stream network analysis operations on an input vector stream file (`streams`). The network indices produced by this analysis are contained within the output vector's (`output`) attribute table. The following table shows each of the network indices that are calculated.

| Index Name | Description
OUTLET | Unique outlet identifying value, used as basin identifier
TRIB_ID | Unique tributary identifying value
DIST2MOUTH | Distance to outlet (i.e., mouth node)
DS_NODES | Number of downstream nodes
TUCL | Total upstream channel length; the channel equivalent to catchment area
MAXUPSDIST | Maximum upstream distance
HORTON | Horton stream order
STRAHLER | Strahler stream order
SHREVE | Shreve stream magnitude
HACK | Hack stream order
MAINSTREAM | Boolean value indicating whether link is the main stream trunk of its basin
MIN_ELEV | Minimum link elevation (from DEM)
MAX_ELEV | Maximum link elevation (from DEM)
IS_OUTLET | Boolean value indicating whether link is an outlet link

In addition to the input and output files, the user must also specify the name of an input DEM file (`dem`), the maximum ridge-cutting height, in DEM z units (`cutting_height`), and the snap distance used for identifying any topological errors in the stream file (`snap`). The main function of the input DEM is to distinguish between outlet and headwater links in the network, which can be differentiated by their elevations during the priority-flood operation used in the algorithm (see Lindsay et al. 2019). The maximum ridge-cutting height parameter is useful for preventing erroneous stream capture in the headwaters when channel heads are very near (within the sanp distance), which is usually very rare. The snap distance parameter is used to deal with certain common topological errors. However, it is advisable that the input streams file be pre-processed prior to analysis.

> Note: The input streams file for this tool should be pre-processed using the repair_stream_vector_topology tool. This is an important step.

OUTLET:

HORTON:

SHREVE:

TRIB_ID:

Many of the network indices output by this tool for vector streams have raster equivalents in WhiteboxTools. For example, see the strahler_stream_order, shreve_stream_magnitude tools.

Tool outputs are: stream lines vector, confluences points vector, outlet points vector, and channel head points vector.

## Reference

Lindsay, JB, Yang, W, Hornby, DD. 2019. Drainage network analysis and structuring of topologically noisy vector stream data. ISPRS International Journal of Geo-Information. 8(9), 422; DOI: 10.3390/ijgi8090422

## See Also

repair_stream_vector_topology, strahler_stream_order, shreve_stream_magnitude

## Function Signature

`def vector_stream_network_analysis(self, streams: Vector, dem: Raster, max_ridge_cutting_height: float = 10.0, snap_distance: f64 = 0.001) -> Tuple[Vector, Vector, Vector, Vector]: ...`

## Project Links

WbW Homepage User Manual Support WbW