Convert osmapiR objects to sf objects
st_as_sf.osmapi_map_notes(x, ...)st_as_sf.osmapi_changesets(x, ...)
st_as_sf.osmapi_gps_track(x, format = c("line", "points"), ...)
st_as_sf.osmapi_gpx(x, format = c("lines", "points"), ...)
Returns a sf
object from sf package or a list of for osmapi_gpx
and format = "points"
.
When x is a osmapi_gps_track
or osmapi_gpx
object and format = "line"
, the result will have XYZM
dimensions
for coordinates, elevation and time if available. In this format, time will loss the POSIXct type as only numeric
For format = "points"
, the result will have XY
dimensions and elevation and time will be independent columns if
available.
an osmapiR object.
passed on to st_as_sf()
from sf package.
Format of the output. If "line"
(the default), return a sf
object with one LINESTRING
for each
track. If "points"
, return a sf
with the POINT
s of the track as features. See below for details.
st_as_sf()
from sf package.
Other methods:
tags_list2wide()
note <- osm_get_notes(note_id = "2067786")
sf::st_as_sf(note)
chaset <- osm_get_changesets(changeset_id = 137595351, include_discussion = TRUE)
sf::st_as_sf(chaset)
gpx <- osm_get_points_gps(bbox = c(-0.3667545, 40.2153246, -0.3354263, 40.2364915))
sf::st_as_sf(gpx, format = "line")
sf::st_as_sf(gpx, format = "points")
if (FALSE) {
# Requires authentication
trk <- osm_get_data_gpx(gpx_id = 3498170, format = "R")
sf::st_as_sf(trk, format = "line")
sf::st_as_sf(trk, format = "points")
}
Run the code above in your browser using DataLab