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")
)
List of longitude, latitude
coordinate pairs, alternatively a two column matrix
or data.frame
.
Route profile, defaults to "driving-car"
.
Maximum radius in meters around given coordinates to search for graph edges
Response format, defaults to "geojson"
Optional parameters as described here
Character scalar containing openrouteservice API key
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.