ors_snap | R Documentation |
Snap coordinates to road network
ors_snap(
locations,
profile = ors_profile(),
radius,
format = c("geojson", "json"),
...,
api_key = ors_api_key(),
output = c("parsed", "text", "sf")
)
locations |
List of |
profile |
Route profile, defaults to |
radius |
Maximum radius in meters around given coordinates to search for graph edges |
format |
Response format, defaults to |
... |
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 |
Coordinates of snapped location(s) and distance to the original point(s) 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
locations <- list(
c(8.669629, 49.413025),
c(8.675841, 49.418532),
c(8.665144, 49.415594)
)
# query for locations snapped onto the OpenStreetMap road network
res <- ors_snap(locations, radius = 350)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.