This forum is shutting down! Please post new discussions at

Calculating distance to stream for multiple TFAs with RouteDEM

Hi there,
I ran RouteDEM with multiple stream thresholds, and I wanted to compare how the distance to stream for different points changed as I changed the TFA. I used TFA of 1400, upper limit 1800, stepsize 200, and checked "calculate distance to stream". This should theoretically have given me three different v_stream outputs, and three different downstream_distance outputs as well (or so I thought). But, although I did get three v_streams, I still only got one downstream_distance.tif. Is this calculated for the first TFA (1400)? or the last (1800)? Or am I missing some output somewhere? It would be great to have the stream distance rasters for each TFA - is that possible? Obviously I could run the tool manually over a range of TFAs and specify a different downstream distance filename each time, but wondering if that is automate-able.



  • RichRich Administrator, NatCap Staff
    Hi Dr. Adrian Vogl, it's me, your office mate and sole developer of RouteDEM.  

    In short, we can handle this through a short batch script.  Wanna Dropbox me your dataset and I can wrap that up nicely for you?  I'll post the script here too for the Adrians of the future.

    But if you care about my thoughts regarding the UI...  I was talking with Stacie about 3 weeks ago about some updates to RouteDEM.  She finds it annoying the UI makes you name output files rather than writing to a workspace with a suffix.  I agree, and made the change for the next version of InVEST.  But while I was in it, I've always found that "looping through threshold cutoffs" a janky feature.  In part because of the issue you raise here.  But also because it's a lousy attempt at batching.  I'd like to avoid adding a loop through distance to stream since it's an orders of magnitude or more complex than stream thresholding.  A mistyped number could set up hours of runtime without an easy way to shut off the run nor feedback about what is happening.  If anything, this is a great addition to dozens of examples of why we need an adaptable "workbench" style UI.  In the meantime, a good API and scripting support can supplement that.  

Sign In or Register to comment.