In our hydromodelling workflow, I needed to first burn knowned streams and culverts paths before using breaching and filling algorithms. As no tool in WBT was allowing that, I coded one uses parts from several existing WBT tools. It works by rasterizing a vector line (Shapefile input) on an existing DEM and then breaching the cells from the first vertex to the last. Lines are burned either by FID order or by ascending order from a specified field to ensure a coherent breaching from the most upstream line to the most downstream one. A flat increment value can be provided like in BreachDepressions.
As a tool like that might be usefull for someone else, I assembled a dataset along with a compiled version of WBT with this tool that can be downloaded (until August 1st) at:
https://transfert.mffp.gouv.qc.ca/?ShareToken=C38658635F1060DA26CAB886D57C3D514F19A7A5The branch having this tool is available also at:
https://github.com/jfbourdon/whitebox-tools/tree/burn_streamsUsage is as follow with --order_by and --flat_increment being optional:
.\whitebox_tools.exe -r=BurnStreams --streams=streams_priority.shp --dem=DEM.flt -o=Burned.flt --order_by=PRIORITY_D --flat_increment=0.0002
There is some limitation/safeguard:
- Only singlepart line vector can be use
- All lines must be within the extent of the raster
- No lines must touch the edge of the raster
- No lines must overlap a NoData cell
It must be noted that this tool doesn't work the same way TopologicalBreachBurn worked in WhiteboxGAT. I made it to fit my needs but if there is interest from the Whitebox team, I can do some modifications to integrate it in the main projet.
Also on a side note, I created the priority field in the shapefile using a script with QGIS' API PyQGIS available at:
https://gist.github.com/jfbourdon/e0010a15e829ec61d21106bfabd38bf8