| gpx | R Documentation |
gpx creates XML output in the GPX format (GPS Exchange Format)
from latitude, longitude and time.
gpx(lat, lon, time, file = NULL)
lat |
latitude of the points |
lon |
longitude of the points |
time |
time of the points (optional) |
file |
destination - can be a character string naming the output
file or a connection to use for output or |
The resulting output is in GPX format contining exactly one track with
the specified values (NAs are currently not supported!). If the
time value is present then the track entries will include a
time nodes as well. No checking is done on time entries so the user
must ensure that they are exactly of the form
YYYY-MM-DD HH:MM:SS, assumed to be in UTC.
(Note that OSM requires time stamps to be present in uploaded tracks.)
If file is NULL then the value is a character vector
containing the lines of the GPX output.
lat <- c(40.779, 40.777) lon <- c(-74.428,-74.418) cat(gpx(lat, lon), sep='\n') cat(gpx(lat, lon, Sys.time()), sep='\n')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.