dem_flow_direction — DEM hydrology op

• Data kinds: depth → labels

• Call: import fullseye as fs; fs.ledger.dem_flow_direction(dem, cell_size, nodata='error') (to call the implementation directly, import demops; demops.dem_flow_direction(dem, cell_size, nodata='error'); from the registry, opsdem.get("dem_flow_direction"))

Usage

D8 flow direction. O'Callaghan & Mark (1984).

The return value is an (H, W) integer array: 0-7 in the order of _D8, -1 meaning "no outflow target" (lower than all neighbours = sink, or flows out of bounds).

With nodata="outlet", flow into missing cells is allowed (it leaves the system there). With "barrier", nothing flows into missing cells. Missing cells themselves are always -1.

Detailed usage guide

• dem_terrain_analysis family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• dem_terrain_analysis_tour — py -3.11 examples/dem_terrain_analysis_tour.py

• poc_geodetic_height_frames — py -3.11 examples/poc_geodetic_height_frames.py

Ops the type connects to (they accept labels as input)

—

Same category (hydrology)

dem_fill_sinks · dem_flow_accumulation · dem_stream_network


*Provenance: demops.py — DEM operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.