Learn R Programming

pgirmess (version 1.6.9)

gps2gpx: Download waypoints or tracks from a GPS to a gpx file

Description

Download waypoints or tracks from a GPS to a gpx file or to the console gpx formatted

Usage

gps2gpx(filename="",i="garmin",f = "usb:", type = "w", invisible = TRUE)

Arguments

filename

a character string naming the file to print to. If '""' (the default), prints to the standard output connection

i

INTYPE: a supported file type, default "garmin"

f

INFILE: the appropriate device interface, default "usb:", on Windows for serial interfaces commonly "com4:" or similar

type

"w" waypoints, or "t" track, or others provided in gpsbabel

invisible

Under Windows, do not open an extra window

Details

The function calls gpsbabel via the system. The gpsbabel program must be present and on the user's PATH for the function to work see http://www.gpsbabel.org. A .gpx suffix is added if not included in the filename. The gpx file can then be read e.g. using readOGR to a sp spatial object. Ex: readOGR("filename.gpx", "waypoints", drop_unsupported_fields=TRUE), or uploaded to a GPS

See Also

readOGR,uploadGPS

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
  # a GPS device must be connected
gps2gpx() # download waypoints and print to the console
gps2gpx(t="t") # download tracks and print to the console
gps2gpx(filename="myfile") # download waypoints and write a gpx file

# }
# NOT RUN {

# }

Run the code above in your browser using DataLab