Clipping Watersheds

83 views
Skip to first unread message

Kevin Ferris

unread,
Aug 12, 2021, 9:10:48 AM8/12/21
to WhiteboxTools
Hi there,  I am currently doing analysis on watersheds. Creating stream networks and analyzing them.  My current project has me choosing some of the sub watershed and analyzing their streams.

My question is... Why won't WBT allow me to run FindMainStem on rasters clipped from the larger watershed model.  I will create a pourpoint for the subwatershed and delineate its boundary. Then clip out from the larger D8 and extract streams raster, then when I try to do FindMainStem using the clipped rasters it will fail to find a main stem.  To get around this I will clip the from hydroconditioned dem and recalculate the D8 and D8FA rasters, extract the streams and find mainstem. The only problem is that sometimes the stream networks will not match the original (created within the larger watershed), for example I will end up with two mainstems in my delineated sub watershed and this is inconsistent with what was originally created. 

Hopefully I was able to explain my problem correctly.  Please let me know if there is anything I can do.  I think the problem lies with the D8 rasters but this is just a hunch. 

Brian Kielstra

unread,
Aug 12, 2021, 1:56:46 PM8/12/21
to WhiteboxTools
I believe that you're right about the problem with clipping the large D8 raster. By clipping, there is likely no "0" to indicate no downslope cell which (I believe, with no Rust experience!) "FindMainStem" relies on that condition.

I'm assuming you're extracting streams with the same D8FA threshold? It is likely the clip causes some edge issues and that the re-generated D8 now has multiple "0" values to start from in your subwatershed. Sorry I can't help more on that - it could be a number of reasons.

One potential solution is to clip the larger D8, D8FA, and streams by the subwatershed boundary. Assuming your subwatershed has one outlet and that the outlet has the highest flow accumulation, you could reclassify the clipped D8FA max to 0 and all else to 1. Then you could multiply this by the clipped D8 to make sure your outlet point D8 is 0. There is no need to re-run D8 or D8FA or extract streams this way. 

Another potential solution would be to expand your subwatershed boundary by ~xx number of cells or distance. Then you can clip the DEM, run D8, run D8FA, extract streams, run FindMainStem tool, then clip by the sub watershed boundary. This might be able to replicate the results of the larger DEM procedure. This might eliminate the edge effects you are seeing and send those problems over to the edge of the expanded subwatershed boundary.  

Kevin Ferris

unread,
Aug 12, 2021, 3:50:57 PM8/12/21
to WhiteboxTools
Brian you are the best!! Thanks so much for taking the time to respond and explaining clearly the issue I was running into with the FindMainStem tool.  To fix my issue I just made the exit point on my D8 a zero (as you suggested) and everything works fine with the clipped rasters.  Now I just need to work that process into my script and I'm off to the races!

Thanks again! Kevin

Reply all
Reply to author
Forward
0 new messages