ors_snap {openrouteservice} | R Documentation |
Openrouteservice Snapping
Description
Snap coordinates to road network
Usage
ors_snap(
locations,
profile = ors_profile(),
radius,
format = c("geojson", "json"),
...,
api_key = ors_api_key(),
output = c("parsed", "text", "sf")
)
Arguments
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 |
Value
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 featuressf
object.
Author(s)
Andrzej OleÅ› andrzej.oles@gmail.com
Examples
# These examples might require interaction to query the local keyring, or
# might fail due to network issues, so they are not run by default
## Not run:
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)
## End(Not run)
[Package openrouteservice version 0.6.2 Index]