Learn R Programming

osmapiR (version 0.2.3)

osm_get_data_gpx: Download GPS Track Data

Description

Use this to download the full GPX file. Private and trackable traces are only available by the owner account. Requires authentication.

Usage

osm_get_data_gpx(gpx_id, format)

Value

If missing format, returns a xml2::xml_document with the original file data. If format = "R", returns a data frame with one point per row and the attributes extracted from the xml response. If format = "sf*", returns a sf object from sf (see st_as_sf() for details). If format = "gpx", returns a xml2::xml_document in the GPX format. If format = "xml", returns a xml2::xml_document in an undocumented format.

Arguments

gpx_id

The track id represented by a numeric or a character value.

format

Format of the output. If missing (default), the response will be the exact file that was uploaded. If "R", a data.frame. If "sf_lines" ("sf" is a synonym for "sf_lines") or "sf_points", a sf object from package sf. If "gpx", the response will always be a GPX format file. If "xml", a xml file in an undocumented format.

See Also

Other get GPS' functions: osm_get_gpx_metadata(), osm_get_points_gps(), osm_list_gpxs()

Examples

Run this code
if (FALSE) {
trk_data <- osm_get_data_gpx(gpx_id = 3498170, format = "R")
trk_data

## get attributes
attr(trk_data, "track")
attr(trk_data, "gpx_attributes")
}

Run the code above in your browser using DataLab