Flow accumulation over a DEM
How much ground drains through every cell of an elevation grid, as a count of upslope cells and an area, by D8 or by D-infinity's split flow.
Experimental: not yet fully verified. How results are checked
At most 10 cells drain through one cell.
| Elevations |
|---|
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
- The area that drains through it
- Its row
- Its column
- Cells with nowhere to go
- At the window's edge
Provenance
- Computed by
- raster.hydrology.flow-accumulation 1.0.0, core 0.1.0
- Model
- D8: each cell sends its whole count to the neighbour of steepest descent, summed in topological order, so a cell's count is 1 plus the counts of every cell pointing to it. D-infinity (Tarboton 1997): a cell's flow is split between the two neighbours its angle lies between, in proportion to the angle, and cells are summed from the highest down. Area = count × cell size²
- Accuracy
- Exact in the arithmetic of each rule: the D8 count is an integer and satisfies the conservation identity at every cell, and the D-infinity split is the angle's own proportion
- Notes
- 1 shown with the answer
- Cites
- O'Callaghan, J. F., and Mark, D. M., Computer Vision, Graphics, and Image Processing, The extraction of drainage networks from digital elevation data; Tarboton, D. G., Water Resources Research, A new method for the determination of flow directions and upslope areas in grid digital elevation models
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: D8: each cell sends its whole count to the neighbour of steepest descent, summed in topological order, so a cell's count is 1 plus the counts of every cell pointing to it. D-infinity (Tarboton 1997): a cell's flow is split between the two neighbours its angle lies between, in proportion to the angle, and cells are summed from the highest down. Area = count × cell size²
Show your work
Where the water goes
each cell's flow to the neighbour of steepest descent100 cells of 30 m= 0 pitsAccumulation
a cell counts itself plus everything draining through it100 cells= 10
The same steps an agent gets from the MCP server with explain: true.
Accuracy: Exact in the arithmetic of each rule: the D8 count is an integer and satisfies the conservation identity at every cell, and the D-infinity split is the angle's own proportion
When to use this: Use this after conditioning a DEM to find where water collects: the count is how many cells drain through each one, and the area is that count times a cell. Channels show up as the cells with high accumulation, which is what a stream threshold picks out. D8 keeps whole cells and is what a watershed needs; D-infinity splits the flow, which is smoother on a hillslope.
Limitations: The window is all the tool knows: a cell near the edge counts only what drains to it from inside the grid, so its value is a lower bound, and a basin that reaches in from outside is not counted. An unconditioned pit swallows everything that reaches it, so fill or breach the grid first; the result counts the pits it found. The grid is plane: the cell area is the cell size squared, so a geographic grid needs its cell size in meters at the latitude. The window holds at most 25,000 cells.
Worked example: A 10 by 10 ramp falling to the east. Source: add-raster-hydrology raster/hydrology, the East ramp accumulation scenario: each row reads 1, 2, 3 … 10 from west to east, counting the cell itself.
You enter
- Cell size
- 30 m
- Elevation grid
- 100, 99, 98, 97, 96, 95, 94, 93, 92, 91 100, 99, 98, 97, 96, 95, 94, 93, 92, 91 100, 99, 98, 97, 96, 95, 94, 93, 92, 91 100, 99, 98, 97, 96, 95, 94, 93, 92, 91 100, 99, 98, 97, 96, 95, 94, 93, 92, 91 100, 99, 98, 97, 96, 95, 94, 93, 92, 91 100, 99, 98, 97, 96, 95, 94, 93, 92, 91 100, 99, 98, 97, 96, 95, 94, 93, 92, 91 100, 99, 98, 97, 96, 95, 94, 93, 92, 91 100, 99, 98, 97, 96, 95, 94, 93, 92, 91
- Method
- d8
You get
- Most cells draining through one cell
- 10
- The area that drains through it
- 9,000 m²
- Its row
- 1
- Its column
- 10
- Cells with nowhere to go
- 0
- At the window's edge
- A cell near the window's edge counts only what drains to it from inside the grid, so its value is a lower bound.
Review: Not yet independently reviewed by a GIS professional.
Last verified: 2026-11-06, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.
Status: version 1.0.0, core 0.1.0. See this tool in the verification report.
Changes
- 2026-11-07, changed: The six hydrology tools now hand their work along. Every flow tool tells you to condition the grid first, and the fill tool's answer is exactly what they want, so its page now offers to carry the conditioned grid straight into the flow tools, with the cell size and the no-data value. The tools also point at each other in the order you would use them: fill, flow direction, accumulation, streams, watershed, longest path. A test routes water over a conditioned grid and over the grid as entered, and shows the difference: no cell left stranded in the first, a pit swallowing the bowl in the second. Changelog
- 2026-11-06, added: A third hydrology tool says how much ground drains through each cell of an elevation grid. The count is the cell itself plus everything upslope of it, and the area is that count times one cell, which is how a channel shows itself: it is where the accumulation passes a threshold. D8 sends each cell's water whole to one neighbour, which is what a watershed needs; D-infinity splits it between the two neighbours the slope angle falls between, which is smoother on open hillside. Near the window's edge a value counts only what drains in from inside the grid, so it is a lower bound, and the result says so. A pit keeps whatever reaches it, so fill or breach the grid first; the tool counts the pits it found and warns. Changelog
Checked against: 19 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Sources
- The extraction of drainage networks from digital elevation data, O'Callaghan, J. F., and Mark, D. M., Computer Vision, Graphics, and Image Processing, Volume 28, issue 3, pages 323-344 (DOI 10.1016/S0734-189X(84)80011-0). The steepest-descent rule that sends each cell's water to one of its eight neighbours, the D8 method.
- A new method for the determination of flow directions and upslope areas in grid digital elevation models, Tarboton, D. G., Water Resources Research, Volume 33, issue 2, pages 309-319 (DOI 10.1029/96WR03137). Equations (1) to (6) and Table 1: the steepest slope over the eight triangular facets of a 3 by 3 window, and the facet factors a_c and a_f that turn a facet's angle into one measured counterclockwise from east.
Terms
- DEM: digital elevation model
- A grid of elevations. A surface model includes buildings and canopy; a terrain model is the ground beneath them. Source: Copernicus DEM GLO-30
Experimental means this tool has not yet met the stable bar: at least 20 golden vectors, differential tests, and an independent worked example.