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

spygen_tracks(waypoints, gps_tracks, distance_threshold, path_save)

Arguments

waypoints

A dataframe, the "good_distance" one obtained with the "spygen_waypoint" function.

gps_tracks

A dataframe of tracks coordinates.

distance_threshold

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

path_save

A character indicating the path to save data.

Value

A list of three dataframe :

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

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

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