Longest flow path to a point
The longest way water travels to the cell you pick, cell by cell, with the distance along it and the height it falls.
Experimental: not yet fully verified. How results are checked
Water travels 270 m to that cell.
| Step | Row | Column | Elevation |
|---|---|---|---|
| 1 | 1 | 1 | 100.000 m |
| 2 | 1 | 2 | 99.000 m |
| 3 | 1 | 3 | 98.000 m |
| 4 | 1 | 4 | 97.000 m |
| 5 | 1 | 5 | 96.000 m |
| 6 | 1 | 6 | 95.000 m |
| 7 | 1 | 7 | 94.000 m |
| 8 | 1 | 8 | 93.000 m |
| 9 | 1 | 9 | 92.000 m |
| 10 | 1 | 10 | 91.000 m |
| Link | Distance east | Distance south |
|---|---|---|
| 1 | 15.000 m | 15.000 m |
| 1 | 45.000 m | 15.000 m |
| 1 | 75.000 m | 15.000 m |
| 1 | 105.000 m | 15.000 m |
| 1 | 135.000 m | 15.000 m |
| 1 | 165.000 m | 15.000 m |
| 1 | 195.000 m | 15.000 m |
| 1 | 225.000 m | 15.000 m |
| 1 | 255.000 m | 15.000 m |
| 1 | 285.000 m | 15.000 m |
- Drop
- Average slope along it
- Cells along it
- Its top row
- Its top column
Provenance
- Computed by
- raster.hydrology.longest-flow-path 1.0.0, core 0.1.0
- Model
- The longest chain of D8 pointers ending at the outlet, found by walking the pointers upstream and keeping, at each cell, the longest branch above it. Length sums the cell size along sides and √2 times it along diagonals between cell centers; the drop is the path's first cell above the outlet, and the average slope is the drop over the length
- Accuracy
- Exact in the arithmetic of the rule over the window given: the path is the longest chain the pointers allow, and its length is the walked chain of cell centres
- Notes
- 1 shown with the answer
- Cites
- Jenson, S. K., and Domingue, J. O., Photogrammetric Engineering and Remote Sensing, Extracting topographic structure from digital elevation data for geographic information system analysis; O'Callaghan, J. F., and Mark, D. M., Computer Vision, Graphics, and Image Processing, The extraction of drainage networks from digital elevation data
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: The longest chain of D8 pointers ending at the outlet, found by walking the pointers upstream and keeping, at each cell, the longest branch above it. Length sums the cell size along sides and √2 times it along diagonals between cell centers; the drop is the path's first cell above the outlet, and the average slope is the drop over the length
Show your work
Upstream from the outlet
the longest branch above each cell, kept all the way up100 cells in the window= 10 cells on the pathIts length
the cell size along a side, √2 times it along a diagonal9 steps of 30 m= 270 m
The same steps an agent gets from the MCP server with explain: true.
Accuracy: Exact in the arithmetic of the rule over the window given: the path is the longest chain the pointers allow, and its length is the walked chain of cell centres
When to use this: Use this for the hydraulic length a time-of-concentration formula asks for: the longest way water travels to a culvert, a gauge, or a basin outlet, with the height it falls on the way. Give the conditioned grid, the cell size, and the outlet's row and column; add the grid's north-west corner to get the path placed in latitude and longitude for a map.
Limitations: The path follows the D8 staircase, so it reads longer than a smooth channel, most of all across a slope that faces between two of the eight directions. The window bounds it: a path that reaches the edge is as much as the data holds. An interior pit cuts a path short, so condition the grid first. The grid is plane, so a geographic grid needs its cell size in meters at the latitude. The window holds at most 25,000 cells.
Worked example: The path to the east edge of a ramp of 30 m cells. Source: add-raster-hydrology raster/hydrology, the Ramp path scenario: 270 m along the row, falling 9 m.
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
- Outlet column
- 10
- Outlet row
- 1
You get
- Path length
- 270 m
- Drop
- 9 m
- Average slope along it
- 0.03333
- Cells along it
- 10
- Its top row
- 1
- Its top column
- 1
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-07, added: The sixth and last hydrology tool measures the longest way water travels to a point: the hydraulic length that a time-of-concentration formula asks for. Give an elevation grid and a cell, and it returns the distance, the height the water falls over it, the average slope along it, and the path itself cell by cell, with the elevation at each. Add the grid's north-west corner and the path comes back placed in latitude and longitude, ready to draw. Diagonal steps count as root two cells, which is why a path down a diagonal valley reads longer than the straight distance across the map. Changelog
Checked against: 15 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Sources
- Extracting topographic structure from digital elevation data for geographic information system analysis, Jenson, S. K., and Domingue, J. O., Photogrammetric Engineering and Remote Sensing, Volume 54, issue 11, pages 1593-1600. Delineating a watershed as every cell whose flow path reaches the outlet, and snapping an outlet onto the drainage network before delineating.
- 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.
Experimental means this tool has not yet met the stable bar: at least 20 golden vectors, differential tests, and an independent worked example.