Learn R Programming

uavRmp (version 0.5)

read_gpx: Read GPX file

Description

Read a GPX file. By default, it reads all possible GPX layers, and only returns shapes for layers that have any features.

Usage

read_gpx(file, layers = c("waypoints", "tracks", "routes", "track_points",
  "route_points"))

Arguments

file

a GPX filename (including directory)

layers

vector of GPX layers. Possible options are "waypoints", "tracks", "routes", "track_points", "route_points". By dedault, all those layers are read.

Value

if the layer has any features a sp object is returned.

Examples

Run this code
# NOT RUN {
## for visualisation we are using mapview
require(mapview)
## assign  GPX file
gpxFN <- system.file("extdata", "flighttrack.gpx", package = "uavRmp")

## read it
gpx <- read_gpx(gpxFN, layers=c("tracks"))

## plot it
mapview::mapview(gpx)

# }

Run the code above in your browser using DataLab