This tool calculates the distance of stream grid cells to the channel network outlet cell for each grid cell belonging to a raster stream network. The user must input a raster containing streams data (streams_raster
), where stream grid cells are denoted by all positive non-zero values, and a D8 flow pointer (i.e. flow direction) raster (d8_pointer). The pointer image is used to traverse the stream network and must only be created using the D8 algorithm. Stream cells are designated in the streams image as all grid cells with 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 the zero_background
parameter is True, in which case non-stream cells will be assigned zero values in the output.
By default, the pointer raster is assumed to use the clockwise indexing method used by Whitebox. If the pointer file contains ESRI flow direction values instead, the esri_pointer
parameter must be True.
downslope_distance_to_stream, length_of_upstream_channels
d8_pointer (Raster): The D8 pointer (flow direction) raster.
streams_raster (Raster): The raster object containing the streams data.
esri_pointer (bool): Determines whether the d8_pointer raster contains pointer data in the Esri format. Default is False.
zero_background (bool): Determines whether the background value in the output raster are assigned zero (True) or NoData values (False). Default is False.
Raster: returning value
def distance_to_outlet(self, d8_pointer: Raster, streams_raster: Raster, esri_pointer: bool = False, zero_background: bool = False) -> Raster: ...