ors_elevation | R Documentation |
Get elevation data for points or lines
ors_elevation(
format_in = c("geojson", "point", "polyline", "encodedpolyline", "encodedpolyline6"),
geometry,
format_out = format_in,
...,
api_key = ors_api_key(),
output = c("parsed", "text", "sf")
)
format_in |
input format |
geometry |
|
format_out |
output format |
... |
Optional parameters as described here |
api_key |
Character scalar containing openrouteservice API key |
output |
Output format. By default the response is being parsed to a list-based R object |
A GeoJSON based service to query SRTM elevation for Point or LineString 2D geometries and return 3D geometries in various formats.
3D point or line geometry structured according to output
:
for "text"
, a character vector of length 1 re-encoded to UTF-8.
for "parsed"
, a parsed R object.
for "sf"
, a simple features sf
object.
Andrzej Oleś andrzej.oles@gmail.com
# point coordinates
coordinates <- c(13.349762, 38.11295)
ors_elevation("point", coordinates)
# geojson as input
point <- '{ "type": "Point", "coordinates": [13.349762, 38.11295] }'
ors_elevation("geojson", point)
# line geometry returned as encoded polyline
coordinates <- list(
c(13.349762, 38.11295),
c(12.638397, 37.645772)
)
ors_elevation("polyline", coordinates, format_out = "encodedpolyline")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.