Export Matched Vessel Tracks with Landing Data
export_matched_tracks.Rd
Retrieves merged landing and vessel tracking data from MongoDB, processes track points in parallel, joins with landing data, and exports the combined dataset back to MongoDB. The function handles the entire pipeline from data retrieval to aggregation and storage.
Usage
export_matched_tracks(log_threshold = logger::DEBUG)
Details
The function performs these main operations:
Retrieves validated landings data from MongoDB
Extracts unique trip IDs
Fetches vessel tracking points in parallel using the PDS API
Joins tracking data with landing information
Processes and aggregates the combined data:
Removes unnecessary columns
Aggregates positions to 10-minute intervals
Calculates mean positions for each interval
Uploads the processed data to MongoDB
Note
Requires appropriate MongoDB connection details and PDS API credentials in the configuration file accessed via read_config().
Data Processing
The function aggregates tracking data by:
Rounding timestamps to 10-minute intervals
Computing mean positions (latitude/longitude) for each interval
Grouping by trip, vessel, and catch information
See also
read_config
for configuration handling
get_trip_points
for PDS API interaction
Examples
if (FALSE) { # \dontrun{
# Export tracks with default settings
export_matched_tracks()
# Export tracks with custom logging level
export_matched_tracks(log_threshold = logger::INFO)
} # }