R/synthetic_stream_network.R
locate_stream_outlet.RdUses the saved NHDPlusV2 reference chain only to identify the approximate downstream cap. The selected outlet is the lowest valid DEM boundary cell near the point where the next downstream NLDI flowline crosses that cap. If NLDI has no continuation, the lowest cap cell near the terminal reference endpoint is used. Reference hydrography does not determine the extracted path.
locate_stream_outlet(
dem,
reference_lines,
search_radius_m = 200,
crossing_radius_m = 30,
downstream_lines = NULL
)Existing projected, single-band Hydro DEM path.
CRS-defined NHDPlusV2 lines with `source_id`.
Radius around the reference endpoint used to inspect the Stream cap.
Maximum boundary-cell distance from the downstream reference crossing.
Optional downstream NLDI lines for deterministic or offline execution. When NULL, NLDI is queried from the terminal COMID.
One-row data frame containing the selected raster cell and evidence.