View source: R/get_route_directions.R
get_routes | R Documentation |
This function takes a successful response object from the 'Azure Maps' API,
extracts the main route and any alternative routes, and combines them into a
single sf
object.
get_routes(resp)
resp |
An |
An sf
object containing the combined main and alternative routes.
If the request was not successful (status code is not 200), the function
will stop with an error.
## Not run:
# Assuming 'response' is a successful response from req_route_directions
all_routes_sf <- get_routes(response)
plot(sf::st_geometry(all_routes_sf))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.