How to edit GPS traces

WARNING: This vignette contain examples that can edit your GPX traces at OpenStreetMap.org. If you prefer to use the testing server, create a user there and configure osmapiR to use it.

library(osmapiR)
set_osmapi_connection(server = "testing") # set the testing server

Upload a local gpx file:

gpx_path <- system.file("extdata", "St_Geroni.gpx", package = "osmapiR")
gpx_id <- osm_create_gpx(
  file = gpx_path,
  description = "Test create gpx with osmapiR.",
  tags = c("testing", "osmapiR")
)

Update the gpx trace metadata:

ori_trace <- osm_get_gpx_metadata(gpx_id = gpx_id)
upd_trace <- osm_update_gpx(
  gpx_id = gpx_id, name = "updated.gpx", description = "Test update gpx with osmapiR",
  tags = c("testing", "osmapiR", "updated"), visibility = "identifiable"
)

Delete the gpx trace:

osm_delete_gpx(gpx_id = gpx_id)