Creates a new context GeoPackage, separate from the network bundle. Supplied identities, optional polygon AOIs, inventory, forensic interpretations and notes are retained without reconciliation or acceptance. External network and terrain-manifest references are relative to the context file's directory and pinned by SHA-256. Move the whole folder, not just this GeoPackage.

write_study_context(
  dsn,
  study_area = NULL,
  streams = NULL,
  reaches = NULL,
  survey_events = NULL,
  reconstruction = NULL,
  network = NULL,
  folder_manifest = NULL,
  terrain_notes = NA_character_,
  analyst_notes = NA_character_,
  analysis_reference = NULL,
  terrain_sources = NULL,
  terrain_evidence = NULL,
  terrain_processing = NULL,
  vertical_reference = NULL
)

Arguments

dsn

New local .gpkg path in an existing directory.

study_area, streams, reaches, survey_events, reconstruction

Context tables accepted by terrain_development_summary(). Only documented context columns are supported; unsupported columns/types fail rather than being dropped. Survey date components must be integer columns. Optional source_dataset and availability_notes are text. AOIs must be XY POLYGON or MULTIPOLYGON sf.

network

Optional root-relative path to an existing network GeoPackage.

folder_manifest

Optional root-relative path to a terrain intake JSON. Explicit event links in that manifest select external GeoTIFF grids; direct SpatRaster objects and an independent overview DEM are not persisted.

terrain_notes, analyst_notes

Optional scalar text, as in the summary.

analysis_reference

Optional saved project-choice table with component, value, basis, evidence, analyst and recorded_at character columns. Requires a Study Area; uses schema 2. Prefer record_study_analysis_reference() for edits.

terrain_sources

Optional attributed source-use table, as documented by record_study_terrain_source(). Requires a Study Area and manifest; uses schema 3.

terrain_evidence

Optional retained attachment table from retain_study_terrain_evidence(). Requires source-use records; uses schema 4.

terrain_processing

Optional ordered preparation accounts from record_study_terrain_processing(). Requires source-use records; uses schema 5.

vertical_reference

Optional structured Study Area vertical target from validate_study_vertical_reference(). Requires a Study Area; uses schema 7.

Value

Normalized context path invisibly. New-file publication requires hard links. Invalid hierarchy fails; missing AOIs and incomplete evidence remain report findings. This is not a complete FGDB project or event-folder binding.