This tool can be used to remove stream links in a stream network that are shorter than a user-specified length (min_length
). The user must input a streams raster image (streams_raster
) and D8 pointer (flow direction) image (d8_pntr
). Stream cells are designated in the streams raster as all positive, nonzero values. Thus all non-stream or background grid cells are commonly assigned either zeros or NoData values. The pointer raster is used to traverse the stream network and should only be created using the D8 algorithm (d8_pointer).
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, the user must specify esri_pntr=True
.
def remove_short_streams(self, d8_pntr: Raster, streams_raster: Raster, min_length: float = 0.0, esri_pntr: bool = False) -> Raster: ...