Flow Direction
For each cell of an elevation raster, the neighbour that water flows to, following the steepest descent (D8).
Pitfall. The same direction has a different code in each engine's encoding; reading one engine's output with another's codes sends water the wrong way.
Pitfall. Flat areas and sinks have no downhill neighbour; engines leave them nodata, 0, or resolve them in their own way.
| Also called | D8 flow direction, D8 pointer, flow pointer, drainage direction |
|---|---|
| Group | raster/hydrology |
| Checks | raster.nodata |
| Pitfalls | 2 listed above |
| Columbus tool | Not stated |
| Notes | Not stated |
| Status | active |
| Broader | Not stated |
| Narrower | Not stated |
| Related |
Parameters
| Name | Type | Required | Default | Values | Note |
|---|---|---|---|---|---|
encoding | enum | no | esri | esri, whitebox, grass, degrees | esri: 1 E, 2 SE, 4 S, 8 SW, 16 W, 32 NW, 64 N, 128 NE. whitebox: 1 NE, 2 E, 4 SE, 8 S, 16 SW, 32 W, 64 NW, 128 N. grass (r.watershed): 1 to 8 counter-clockwise from NE, west 4. degrees (r.fill.dir): counter-clockwise from east, west 180. |
Inputs and outputs
| Direction | Name | Type | Geometry | Note |
|---|---|---|---|---|
| Input | raster | raster | Not stated | An elevation model, usually with sinks filled. |
| Output | output | raster | Not stated | Not stated |
In each engine
| Engine | Tool | Parameters | Differences |
|---|---|---|---|
grass | r.fill.dir |
|
Preset: {"output":"filled"} |
grass | r.watershed |
|
Preset: {"flag_s":true,"flag_a":true} |
terra | terra::terrain |
| None noted
Preset: {"v":"flowdir"} |
whiteboxtools | D8Pointer |
|
|
xarray-spatial | xrspatial.hydro.flow_direction_d8 |
|
|