A collection of functions for calculating the upslope area and related measurements for a digital elevation model (DEM).
Based on the method of Tarboton.
See also the upslope area postings on my image processing blog, March-August 2007, http://blogs.mathworks.com/steve.
Requires Image Processing Toolbox.
Functions include dem_flow, dependence_map, facet_flow, fill_sinks, flow_matrix, influence_map, pixel_flow, postprocess_plateaus, upslope_area, vis_dem_flow, and vis_map.
Includes a sample DEM data set.
dEns - It did not require a password when I downloaded it just now. Do you get the same thing when you download other File Exchange submissions?
a password is requested to open the .zip file. Is there a specific way to obtain it?
Andres - See influence_map.
Thanks for your answer Steve.
Sorry, but I have another question: is it possible to calculate the dowstream path for each pixel of the catchment (again I would need the coordinates or location of the pixels that are included in each of these downstream paths)?
Andres - Yes. Look at the function dependence_map.
Thank you for the algorithm.
I am trying to get the upslope areas for each pixel of the catchment, not just the value of the area, but the coordinates or location of the pixels that are included in each of these upslope areas. Is it possible with your algorithm?
Thank you in advance.
Bard, I am not doing any active algorithm development in this area right now, and I have no plans to enhance this submission. You might want to take a look at Wolfgang Schwanghart's TopoToolbox: http://physiogeo.unibas.ch/topotoolbox/
Great algorithm, how would modify it to include flow length as well?
How do you combine this script with flow data?
If the flow was the same for each pixel I could simply multiple the upslope area by a constant. Since this is not the case I need to find a way of inputting my flow data as it calculates the up slope area.
Can anyone enlighten me,
After implementing Tarbotons Dinf algorithm for calculating flow directions I finally stumpled upon your toolbox, which is a lot faster. Thanks for the implementation, maybe if you add a keyword 'flow direction' it could save some other users some work ;-)
areas of interest to geographers often are catchments which commonly have irregular shape. Beyond the watersheds there is often a lack of data. Hence, these values outside the catchment are NaNs. While NaNs inside the catchment may be interpolated the NaNs outside can merely be extrapolated.
Hence, I tried following. I replaced the NaNs in the DEM by -Inf. That works except that it produces an erroneous flow direction on the watershed pixels.
Do you have opinion about should be done with NaNs?
great contribution! Users of older Matlab versions (R14) need to replace the function hypot(s1,s2) by
s = sqrt(abs(s1).^2 + abs(s2).^2)
One critique: The functions don't handle NaNs.
Best regards, Wolfgang
Use assertElementsAlmostEqual in unit tests.
Version 1.4.2 - Added sample DEM data source information to Contents.m. No functional changes in this version.
* Fixed M-file help typo in dependence_map.m.
* Allowed input matrix E to contain NaNs in postprocess_plateaus.m.
* Added unit test directory.
Version 1.4 - modified fill_sinks.m to fill using 8-connectivity instead of 4-connectivity.
Version 1.3. Corrected border NaN computation for dependence_map and influence_map.
Version 1.2. Alter handling of border-connected NaN pixels based on feedback from Wolfgang and others.
Based on feedback I've received, I removed the "plateau flattening" step from the upslope area computation. This step is now provided as a separate function.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.