Learn R Programming

uavRmp (version 0.6.0)

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")
)

Value

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

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.

Examples

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

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

## plot it
plot(gpx$geometry)

}

Run the code above in your browser using DataLab