nearest_api_v4 {osrmr} | R Documentation |
nearest_api_v4() calculates the nearest position to the given coordinates which can be accessed by car with the OSRM API 4. The coordinate-standard is WGS84. Attention: The OSRM API v4 is only working locally, but not with the 'OSRM' webserver.
nearest_api_v4(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
## Not run:
Sys.setenv("OSRM_PATH_API_4"="C:/OSRM_API4")
osrmr::run_server(Sys.getenv("OSRM_PATH_API_4"), "switzerland-latest.osrm")
osrmr:::nearest_api_v4(47,9, osrmr:::server_address(TRUE))
osrmr::quit_server()
Sys.unsetenv("OSRM_PATH_API_4")
## End(Not run)