This function attributes to each spygen survey it's closest waypoint at the date of the survey.

spygen_waypoint(eDNA_metadata_path, waypoints, distance_threshold, path_save)

Arguments

eDNA_metadata_path

A character indicating eDNA metadata path. These metadata includes spygen survey coordinates and dates.

waypoints

A dataframe of waypoints coordinates.

distance_threshold

A numeric indicating the maximal distance threshold in meter between a spygen survey coordinates and the closest waypoint coordinates.

path_save

A character indicating the path to save data.

Value

A list of three dataframes :

"high distance" contain spygen survey with distance to the closest waypoints > distance_threshold;

"good distance" contain spygen survey with distance to the closest waypoints < distance_threshold;

"na survey" contain spygen survey with no attributed waypoints.