write_gpx: Function to export geometries as a GPX file.

View source: R/write_gpx.R

write_gpxR Documentation

Function to export geometries as a GPX file.

Description

write_gpx uses rgdal::writeOGR as the GPX writer. GPX files do not support polygons, therefore polygon geometries will be coerced to lines.

Usage

write_gpx(sp, file, force = TRUE)

Arguments

sp

Spatial object.

file

File name of GPX file.

force

Should the projection be forced to WGS84? Default is TRUE because this is the standard for GPX files.

Value

Invisible.

Author(s)

Stuart K. Grange

Examples

## Not run: 

# Export a GPX file containing points
write_gpx(sp_bus_stations, "~/Desktop/bus_stations.gpx")

# Export GPX file which contains a track
write_gpx(sp_gpx_track, "~/Desktop/drive_to_bath.gpx")


## End(Not run)


skgrange/gissr documentation built on June 20, 2024, 12:02 a.m.