R/set_study_reach_areas.R
set_study_reach_areas.RdMatches explicit saved Reach IDs, never names, row positions or spatial overlap. Only geometry changes; all identities, names, parentage, events and links remain. This does not define how a Reach area should be delineated or approve its scope.
set_study_reach_areas(
dsn,
output_file,
areas,
id_column = "reach_id",
add_note,
report_file = NULL,
report_purpose = "definition"
)Existing context GeoPackage containing Reaches.
New .gpkg beside dsn; existing files are refused.
Nonempty sf of valid finite CRS-defined XY polygons, one per explicitly selected existing Reach. Native geometry is retained.
Exact text field containing saved reach_id values, default reach_id. Every value must match a different existing Reach. Other source attributes are ignored, not used to rename or reparent records.
Required source and delineation/revision rationale.
Optional new .html destination in an existing directory.
Report view: definition (default), terrain or staging.
List of context and report paths. When Reaches have no geometry, supply every recorded Reach's area together: schema 1 cannot mix missing and supplied areas. Once areas exist, a subset may be revised in the same semantic CRS and polygon class. No repair, dissolve, reprojection, clipping, new identities, Survey Events or source-ID reconciliation is performed. Existing outputs are never replaced. Rendering failure may leave the saved context; keep it and retry read-only reporting. A rationale is not a full provenance ledger.