This package calculates water flow paths and catchments on
- digital elevation models (DEMs), and
- underneath glaciers and ice sheets (subglacial drainage)
and can quantify uncertainties using a Monte Carlo approach.
WhereTheWaterFlows has been used in glaciological contexts, see References in the documentation, but could be useful in other settings as well.
It implements the D8 flow routing algorithm combined with a breach-type basin-filling algorithm as described by [1]. Its implementation uses a O(n), recursive algorithm [2]. The model's performance is on par or better than other routing tools according to our take-them-with-a-grain-of-salt benchmarks.
Example of an upslope area calculation on a synthetic digital elevation model:
using WhereTheWaterFlows, CairoMakie
# build a small synthetic DEM
n = 200
x = y = range(-π, π, length=n)
dem = sin.(x).*cos.(y') .+ 0.05*rand(n,n)
out = waterflows(dem)
plt_area(x, y, out.area)For details, see the documentation.
Geomorphometry.jl includes flow routing (among other functionality) using the FD8 algorithm which includes D8.
[1] O’Callaghan, J. and Mark, D.: The extraction of drainage networks from digital elevation data, Comput. Vision Graph., 28, 323–344, 1984. download via google scholar
[2] Braun, J. and Willett, S.D.: A very efficient O(n), implicit and parallel method to solve the stream power equation governing fluvial incision and landscape evolution, Geomorphology, 2013. link
