osm_elevation | R Documentation |
Add elevation data to a previously-extracted OSM data set, using a
pre-downloaded global elevation file from
https://srtm.csi.cgiar.org/srtmdata/. Currently only works for
SC
-class objects returned from osmdata_sc.
osm_elevation(dat, elev_file)
dat |
An |
elev_file |
A vector of one or more character strings specifying paths
to |
A modified version of the input dat
with an additional z_
column
appended to the vertices.
Other transform:
osm_poly2line()
,
trim_osmdata()
,
unique_osmdata()
,
unname_osmdata_sf()
## Not run:
query <- opq ("omaha nebraska") |>
add_osm_feature (key = "highway")
# Elevation can only be applied to \pkg{silicate} 'SC'-class data:
dat <- osmdata_sc (query)
dat$vertex
# The vertex table will have columns ("x_", "y_", "vertex_"). Then
# download elevation data from \url{https://srtm.csi.cgiar.org/srtmdata/}
# (or elsewhere), and add elevation column, "z_" with:
dat <- osm_elevation (dat, elev_file = "/path/to/elevation/data.tiff")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.