Import GPX Waypoints and Tracks directly from a GPS plugged into a Mac.
rfp_gpx_import.Rd
This function reads GPX files from specified directories, extracts waypoints and tracks, and saves them into specified formats based on provided time filters.
Usage
rfp_gpx_import(
dir_gpx_waypoints = "/Volumes/GARMIN/Garmin/GPX/",
dir_gpx_tracks = c("/Volumes/GARMIN/Garmin/GPX/Archive/",
"/Volumes/GARMIN/Garmin/GPX/Current/"),
dir_out = "~/Library/CloudStorage/OneDrive-Personal/Projects/2024_data/gps",
time_start = "2024-01-01",
time_end = "2099-01-01",
layer_output_name = "2024_ai",
gpkg_name = "gps_2024",
dates_view = FALSE,
gpx_layer_type = c("waypoints", "tracks", "track_points")
)
Arguments
- dir_gpx_waypoints
A character string specifying the directory containing GPX waypoint files. Default is '/Volumes/GARMIN/Garmin/GPX/'.
- dir_gpx_tracks
A character vector specifying the directories containing GPX track files. Default is c("/Volumes/GARMIN/Garmin/GPX/Archive/", "/Volumes/GARMIN/Garmin/GPX/Current/").
- dir_out
A character string specifying the directory to save the output files. Default is '~/Library/CloudStorage/OneDrive-Personal/Projects/2024_data/gps'.
- time_start
A character string representing the start date for filtering waypoints and tracks based on when the . waypoint was created and the END time of each track (if the track was automatically wrapped by the gps. Default is "2024-01-01".
- time_end
A character string representing the end date for filtering waypoints and tracks based on when the . waypoint was created and the END time of each track (if the track was automatically wrapped by the gps. Default is "2099-01-01".
- layer_output_name
A character string specifying the name of the layer to export and the string to append to each waypoint and track so that name collisions do not occur and to specify surveyor. Default is "2024_ai". This is appended to each layer's name (e.g., gps_waypoints_2024_ai.gpx).
- gpkg_name
A character string specifying the filename for the GPKG export. Default is "gps_2024". This creates a geopackage named gps_2024.gpkg.
- dates_view
A logical flag indicating whether to display the filtered waypoint dates in a pretty format in the terminal. Default is FALSE. If dates are displayed in the terminal, the output files are not generated. This is useful for visualizing options for setting time_start and time_end params.
- gpx_layer_type
A character vector specifying the types of layers to read from the GPX files. Default is c("waypoints", "tracks", "track_points"). "routes" and "route_points" are untested.