write_gpx: Export an OSM transport line to GPX

Description Usage Arguments Value Content of the file Details Examples

View source: R/write_gpx.R

Description

Fetch the data on OpenStreetMap server, processes it and export it to a GPX file.

Usage

1
2
3
4
5
6
7
8
write_gpx(
  id_rel,
  path = ".",
  filename = NULL,
  osm_info = TRUE,
  overpass_url = "http://overpass-api.de/api/interpreter",
  quiet = FALSE
)

Arguments

id_rel

the identifier of the OpenStreetMap relation.

path

the directory where to write the GPX file.

filename

name of the file. If NULL (default), a name based on the tags route, ref and id of the OSM relation.

osm_info

include informations about OpenStreetMap nodes (id and version).

overpass_url

instance of the Overpass API to use to retrieve data (see this page for a list of available instances).

quiet

TRUE to desactivate information messages.

Value

The data used to export the file, invisibly. This is the same as the result of extract_data.

Content of the file

Details

The data coming from the OSM server must be clean for the processing to succeed.

As stated in the OSM documentation, the ways in the relation should be listed beginning with the way at the initial stop position and ending with the way at the terminal stop, in the right order. The package will automatically reverse some ways to produce a continuous track.

If roundabouts (or any circular ways) are part of the track, osmbus will find its way through them, i.e. it will select the only nodes used by the transport vehicle from entrance to exit.

Examples

1
2
3
4
5
## Not run: 

write_gpx(id_rel = "123767")

## End(Not run)

py-b/osmbus documentation built on Dec. 31, 2020, 2:10 a.m.