Merge Survey and GPS Trip Data
merge_trips.RdMatches catch surveys to GPS trips using fuzzy matching on boat identifiers, then merges all records (matched and unmatched) and uploads to cloud storage.
Arguments
- site
Character. Site identifier: "kenya" or "zanzibar"
- log_threshold
Logger threshold level. Default is
logger::DEBUG.
Value
Invisible NULL. Uploads merged parquet file to cloud storage 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
Details
The function executes a five-step pipeline:
Load device registry from cloud storage
Load validated surveys
Load preprocessed GPS trips
Match surveys to trips via fuzzy matching (surveys -> registry -> trips)
Merge matched subset with all unmatched records and upload
Site-specific configuration is handled automatically based on the site parameter.