This tool identifies all interior and exterior links, and source, link, and sink nodes in an input stream network (streams_raster
). The input streams raster is used to designate which grid cells contain a stream and the pointer image is used to traverse the stream network. Stream cells are designated in the streams image as all values greater than zero. Thus, all non-stream or background grid cells are commonly assigned either zeros or NoData values. Background cells will be assigned the NoData value in the output image, unless zero_background=True
, in which case non-stream cells will be assigned zero values in the output.
Each feature is assigned the following identifier in the output image:
Value | Stream Type ----- | ----------- 1 | Exterior Link 2 | Interior Link 3 | Source Node (head water) 4 | Link Node 5 | Sink Node
The user must input an input stream raster (streams_raster
) and a pointer (flow direction) raster (d8_pntr
). The flow pointer and streams rasters should be generated using the d8_pointer algorithm. This will require a depressionless DEM, processed using either the breach_depressions_least_cost or fill_depressions tools.
By default, the pointer raster is assumed to use the clockwise indexing method used by WhiteboxTools. If the pointer file contains ESRI flow direction values instead, set esri_pntr=True
.
def stream_link_class(self, d8_pntr: Raster, streams_raster: Raster, esri_pntr: bool = False, zero_background: bool = False) -> Raster: ...