writeGPX: Convert a data frame into a GPX file of waypoints or track
Description
Convert a data frame of labels, geographical coordinates and optionally altitude into a GPX file of waypoints or track that can be uploaded to Garmin GPS
Usage
writeGPX(x, filename = "",type="w")
Arguments
x
data.frame of three (optionally four) columns (see details)
filename
a character string naming the file to print to. If '""' (the default), prints to the standard output connection, the console (unless redirected by 'sink')
type
'w' for waypoints (default) or 't' for track
Details
The data frame must have three (optionally four) columns:
character or integer, waypoint ID for waypoints ; column not read for track
numeric, longitude (decimal degrees), negative for west
numeric, latitude (decimal degrees), negative for south
numeric, elevation (meters) (optional)
A suffix '.gpx' is added to the file name if not provided by user. The file obtained can be uploaded to Garmin GPS but cannot be read eg from MapSource for some reasons.