dem_stream_network — DEM hydrology op

• Data kinds: depth → image2d

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

Usage

Binary mask that treats cells whose flow accumulation exceeds a threshold as stream channels.

Procedure: use dem_flow_accumulation(dem, cell_size, fill, nodata) to get each cell's accumulated cell count (counting the cell itself as 1), set acc >= threshold_cells to 1 and everything else to 0. Missing cells stay nan.

• threshold_cells: accumulated cell count regarded as a channel. Positive finite (ValueError). To decide by area, convert to area [m^2] / cell_size^2 and pass that (this op only accepts cell counts).

• fill=True (default): first fill sinks with priority-flood (dem_fill_sinks, epsilon=1e-6). Otherwise flow stops in sinks, downstream accumulation comes out small, and channels break off.

• nodata: "error" (default, rejects if nan present) / "outlet" (missing = outlet, suited to water bodies) / "barrier" (missing = wall). There is no option to fill holes with a constant.

• dem / cell_size contract is the same as dem_slope (3x3 or larger, sentinel values rejected, [m]).

• Return value: (H, W) float64 of 0 / 1 (missing is nan). Not bool, so binarise with == 1 before passing to blob_label etc.

• Complexity: the topological sweep for accumulation is a Python loop over all cells.

Being based on D8 flow direction (dem_flow_direction), flow tends to converge on one spot on flat reclaimed land ―― lowering the threshold too far produces grid-shaped false channels.

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

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

—

Same category (hydrology)

dem_fill_sinks · dem_flow_direction · dem_flow_accumulation


*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.