st_as_sf | R Documentation |
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"), ...)
x |
an osmapiR object. |
... |
passed on to |
format |
Format of the output. If |
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.
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")
## Not run:
# 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")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.