Description Usage Arguments Details Value Examples
run_server() starts your local OSRM server by using a shell command (depending on your OS). A local (pre-built) version of the OSRM-engine must be on your device. (https://github.com/Project-OSRM/osrm-backend/wiki/Building-OSRM).
1 | run_server(map_name, osrm_path = Sys.getenv("OSRM_PATH"))
|
map_name |
A character (name of your pre-built map - e.g. "switzerland-latest.osrm") |
osrm_path |
A string pointing to your local OSRM installation. Default is the environment variable "OSRM_PATH". |
To start the server, it is necessary to know its location. If it was installed in C:/OSRM_APIx, it is easiest to set an environment variable which points to the folder via Sys.setenv(). Note: You need to set the variable in each session.
error_code A character
1 2 3 4 5 6 7 8 9 | ## Not run:
Sys.setenv("OSRM_PATH"="C:/OSRM_API4")
osrmr::run_server("switzerland-latest.osrm")
# 0
Sys.setenv("OSRM_PATH"="C:/OSRM_API5")
osrmr::run_server("switzerland-latest.osrm")
# 0
Sys.unsetenv("OSRM_PATH")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.