Description Usage Arguments Value Examples
nearest_api_v5() calculates the nearest position to the given coordinates which can be accessed by car with the OSRM API v5. The coordinate-standard is WGS84.
1 | nearest_api_v5(lat, lng, address)
|
lat, |
A numeric (-90 < lat < 90) |
lng, |
A numeric (-180 < lng < 180) |
address, |
A character specifying the serveraddress (local or online) |
A data.frame with lat and lng
1 2 3 4 5 6 7 8 | ## Not run:
osrmr:::nearest_api_v5(47,9, osrmr:::server_address(FALSE))
Sys.setenv("OSRM_PATH_API_5"="C:/OSRM_API5")
osrmr::run_server(Sys.getenv("OSRM_PATH_API_5"), "switzerland-latest.osrm")
osrmr:::nearest_api_v5(47,9, osrmr:::server_address(TRUE))
osrmr::quit_server()
Sys.unsetenv("OSRM_PATH_API_5")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.