pygeoprocessing.routing.helper_functions module

pygeoprocessing.routing.helper_functions.extract_streams_d8(flow_accum_raster_path_band, flow_threshold, target_stream_raster_path, raster_driver_creation_tuple=('GTIFF', ('TILED=YES', 'BIGTIFF=YES', 'COMPRESS=LZW', 'BLOCKXSIZE=256', 'BLOCKYSIZE=256')))[source]

Extract D8 streams based on a flow accumulation threshold.

Creates an unsigned byte raster where pixel values of 1 indicate the presence of a stream and pixel values of 0 indicate the absence of a stream. Any flow accumulation pixels greater than flow_threshold are considered stream pixels. Nodata values found in the input flow accumulation raster propagate through to the target stream raster.

Parameters
  • flow_accum_raster_path_band (tuple) – A (path, band) tuple indicating the path to a D8 flow accumulation raster and the band index to use.

  • flow_threshold (number) – The flow threshold. Flow accumulation values greater than this threshold are considered stream pixels, values less than this threshold are non-stream pixels.

  • target_stream_raster_path (string) – Where the target streams raster should be written.

  • raster_driver_creation_tuple (tuple) – A tuple where the first element is the GDAL driver name of the target raster and the second element is an iterable of raster creation options for the selected driver.

Returns

None