This tool can be used to calculate the distance from each grid cell in a raster to the nearest stream cell, measured along the downslope flowpath. The user must specify the name of an input digital elevation model (`dem`) and streams raster (`streams`). The DEM must have been pre-processed to remove artifact topographic depressions and flat areas (see breach_depressions_least_cost). The streams raster should have been created using one of the DEM-based stream mapping methods, i.e. contributing area thresholding. Stream cells are designated in this raster as all non-zero values. The output of this tool, along with the elevation_above_stream tool, can be useful for preliminary flood plain mapping when combined with high-accuracy DEM data.

By default, this tool calculates flow-path using the D8 flow algorithm. However, the user may specify (`dinf`) that the tool should use the D-infinity algorithm instead.

## See Also

elevation_above_stream, distance_to_outlet

## Function Signature

`def downslope_distance_to_stream(self, dem: Raster, streams: Raster, use_dinf: bool = False) -> Raster: ...`

## Project Links

WbW Homepage User Manual Support WbW