study_reach_merge.RdVerifies retained source evidence and combines its inherited-buffer geometry under one selected Reach identity. Other selected identities leave the current inventory but remain in prior revisions. No source files are changed.
preview_study_reach_merge(dsn, reach_ids, retain_reach_id)
merge_study_reaches(dsn, output_file, reach_ids, retain_reach_id,
reach_name, report_purpose = "definition")Existing study context GeoPackage.
New context GeoPackage beside dsn; never overwritten.
Two or more distinct saved Reach identities from one Stream.
One selected identity to retain.
Combined Reach name, unique in its parent Stream.
Revision purpose: definition, terrain or staging.
Survey Events retain their IDs, dates and attributes; only retired parent Reach IDs are reassigned. Linked network and terrain-manifest references require separate reconciliation and block this operation. Missing, changed or stale Reach evidence also blocks merging. Evidence-first publication may leave an unreferenced evidence file on failure. Disconnected parts and overlaps are not repaired. Neither a complete network nor scientific acceptance is inferred.
Preview returns the combined corridor, source mapping, retained and retired IDs, retained name and reassigned event count. Save returns revision paths, evidence and the retained reach_id.