elevation_get | R Documentation |
elevation_get()
uses the
cc_elevation()
function from the ceramic
package to get
DEM data in raster format anywhere worldwide.
It requires an API that can be added by following guidance in the package's
README
and in the
slopes
vignette.
elevation_get(routes, ..., output_format = "raster")
routes |
Routes, the gradients of which are to be calculated.
The object must be of class |
... |
Options passed to |
output_format |
What format to return the data in?
Accepts |
Note: if you use the cc_elevation()
function directly to get DEM data,
you can cache the data, as described in the package's
README.
A raster object with cell values representing elevations in the
bounding box of the input routes
object.
# Time-consuming examples that require an internet connection and API key:
library(sf)
library(raster)
routes = cyclestreets_route
e = elevation_get(routes)
class(e)
crs(e)
e
plot(e)
plot(st_geometry(routes), add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.