Aggregate flowpath network topology without divide geometry
Source:R/aggregate_network_and_divides.R
aggregate_network.RdFlowpath-only replacement for the aggregate-to-distribution step.
Runs mainstem aggregation and headwater collapse using purely graph/tabular
operations, no union_polygons, terra::makeValid, st_snap, or
terra::relate. Returns aggregated flowpaths, network table, and poi layer.
The returned divides element is a geometry-free stub (data.frame) carrying
only divide_id and flowpath_toid. Pass it with rec_div to
construct_agg_divides() to build real divide geometry.
Usage
aggregate_network(
flowpath,
divide,
pois = NULL,
vpu = NULL,
max_junction = 2,
ideal_size_sqkm = 10,
min_area_sqkm = 3,
max_area_sqkm = 15,
min_length_km = 0.25,
connector_ids = NULL
)Arguments
- flowpath
Reconciled flowpath
sffrom Stage-1rec_fp_agg.- divide
Reconciled divide
sffrom Stage-1rec_div. Used only byprepare_network()for initial topology setup.- pois
POI
sffrom the refactor phase.- vpu
VPU identifier written to network table.
- max_junction, ideal_size_sqkm, min_area_sqkm, max_area_sqkm, min_length_km
Aggregation parameters.
- connector_ids
Optional character vector of catchment-less connector reach ids (e.g. divide-less reaches over waterbodies). Such reaches are held out of the small-catchment collapse/absorb steps so they are preserved rather than merged away.
NULL(default) treats none as connectors.