
Merge Survey and GPS Trip Data
merge_trips.RdRuns the matching pipeline for all surveys (KEFS and WCS), combines the results into a single country-level dataset, appends truly unmatched GPS trips, and uploads to cloud storage.
Usage
merge_trips(log_threshold = logger::DEBUG)Arguments
- log_threshold
Logger threshold level. Default is
logger::DEBUG.
Value
Invisible NULL. Uploads a merged parquet file to
conf$surveys$matched_trips$file_prefix containing:
Matched survey-trip pairs (both submission_id and trip are non-NA)
Unmatched surveys (trip = NA)
Unmatched trips (submission_id = NA)
Match quality indicators: n_fields_used, n_fields_ok, match_ok
A
surveycolumn identifying the source ("kefs" or "wcs"; NA for unmatched trips)
Details
The function executes a six-step pipeline:
Load the shared device registry from cloud storage
Load GPS trips from cloud storage
Run
compute_survey_matches()for KEFS (uses registration number, boat name, and fisher name for fuzzy matching)Run
compute_survey_matches()for WCS (uses boat name only)Identify trips not claimed by either survey's matching output
Combine all records and upload to
conf$surveys$matched_trips$file_prefix
The device registry and GPS trips are loaded once and shared across both survey pipelines.