Skip to contents

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)

Arguments

log_threshold

Logging threshold level (default: logger::DEBUG)

Value

None. Processes data and uploads results to MongoDB.

Details

The function performs these main operations:

  1. Retrieves validated landings data from MongoDB

  2. Extracts unique trip IDs

  3. Fetches vessel tracking points in parallel using the PDS API

  4. Joins tracking data with landing information

  5. Processes and aggregates the combined data:

    • Removes unnecessary columns

    • Aggregates positions to 10-minute intervals

    • Calculates mean positions for each interval

  6. 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)
} # }