Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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", "routes", "tracks", "route_points", "track_points"),
  remove.empty.layers = TRUE,
  as.sf = TRUE
)

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.

remove.empty.layers

should empty layers (i.e. with 0 features) be removed from the list?

as.sf

not used anymore

Details

Note that this function returns sf objects, but still uses methods from sp and rgdal internally.

Value

a list of sf objects, one for each layer


tmaptools

Thematic Map Tools

v3.1-1
GPL-3
Authors
Martijn Tennekes [aut, cre]
Initial release
2021-01-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.