Do not use these instructions - they are no longer valid with newer releases. Try this link.
Do not use these instructions - they are no longer valid with newer releases. Try this link.
Here are the steps I took to get openrouteservice (ORS) installed locally on my laptop (Windows 10 Home x64, Intel i7-9750H). Most of this is thanks to a forum post from 'johntdata' explaining setup for Windows 10 Pro, but I wanted to add more details and highlight a couple of things that Windows 10 Home users might need to do differently. I don't know if these steps are foolproof (I have no other experience with Java or Docker), but I hope this ends up being useful for someone else in a similar situation. You may also find the ORS documentation/instructions here and here to be useful once the basic installation is completed.
Step 1
Check if your machine has CPU virtualization enabled (in Task Manager, navigate to Performance -> CPU). If not, you will need to enable it via BIOS.
Step 2
Download Docker from here and install it as instructed. Once the setup completes, restart your computer. Upon restart, you may be prompted to install a WSL2 update package from the Microsoft website. Follow the instructions to do so, and restart your computer again.
Step 3
Start Docker Desktop. Open Task Manager. If the values in Task Manager aren't updating (this happened to me when I first started Docker), navigate to View -> Update Speed and select High. Sort the process list by descending memory usage. You should see a process named 'Vmmem' taking up a huge chunk of memory. This indicates that Docker is up and running.
Step 4
Open the Windows command prompt from the Start menu. Enter the command docker info. You should see something like this (some info removed for privacy, emphasis mine):
>docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
compose: Docker Compose (Docker Inc., 2.0.0-beta.1)
scan: Docker Scan (Docker Inc., v0.8.0)
Server:
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 3
.
.
.
Architecture: x86_64
CPUs: 12
Total Memory: 12.34GiB
Name: docker-desktop
ID:
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
Live Restore Enabled: false
WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
The default Docker root directory (bolded above) is important information. It seems to me that other operating systems allow you to change this directory in Docker Settings -> Resources, but Windows 10 Home does not. However, using the default root directory shouldn't cause any problems.
Step 4
Decide where you want to store your OpenStreetMap files; I placed it in a new folder C:/OSMFiles. For testing purposes, download the (relatively small) North Dakota .osm.pbf file from here, and place it in your OSM folder.
Step 5
In the command prompt, enter the command docker pull openrouteservice/openrouteservice. Wait for all of the components to download. This might take a couple of minutes.
Step 6
We will set up our map for use with ORS in port 8080. In the command prompt, enter the following command:
docker run -dt --name ors-app -p 8080:8080 -e BUILD_GRAPHS=True -v /var/lib/docker/graphs:/ors-core/data/graphs -v /var/lib/docker/elevation_cache:/ors-core/data/elevation_cache -v /var/lib/docker/conf:/ors-conf -v C:/OSMFiles/north-dakota-latest.osm.pbf:/ors-core/data/osm_file.pbf -e "JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g" -e "CATALINA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost" openrouteservice/openrouteservice:latest
If your root directory is not /var/lib/docker, replace it with your root directory in the command above. If your OSM folder is not C:/OSMFiles, replace it with your OSM folder in the command above. In the future, you can replace north-dakota-latest.osm.pbf with any downloaded map of your choosing. If you want to re-use your most recently built graph, feel free to omit -e BUILD_GRAPHS=True. However, you will need to include that statement any time you want to work with a different map.
Once you enter the command, if successful, you will see a long hexadecimal string such as:
a727eef15627991fa4be508df530ad90edf21821d1ce86a6e1714bc805c9b970
This means that Docker has started setting up your container.
Step 7
In the Docker Desktop window, navigate to 'Containers/Apps' and click the 'ors-app' container. Under the 'Logs' tab, you should see many lines of text that begin with:
### Package openrouteservice and deploy to Tomcat ###
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
You should be able to safely ignore these warnings. New logs will continue to appear over the course of a few minutes. Eventually, you will see logs similar to this:
31 May 00:34:01 INFO [core.PrepareCore] - 0, updates:0, nodes: 292 585, shortcuts:0, dijkstras:1 383 996, t(dijk):0.66, t(period):0.0, t(lazy):0.0, t(neighbor):0.0, meanDegree:1, algo:4MB, totalMB:1026, usedMB:484
This indicates that graphs are being built from the provided map. This process will continue for at least five minutes (increasing with the size of the provided map) and will eventually terminate with the following logs:
31 May 00:38:02 INFO [routing.RoutingProfile] - [1] FlagEncoders: 1, bits used [UNKNOWN]/64.
31 May 00:38:02 INFO [routing.RoutingProfile] - [1] Capacity: [UNKNOWN]. (edges - 400588, nodes - 292585)
31 May 00:38:02 INFO [routing.RoutingProfile] - [1] Total time: 305.428s.
31 May 00:38:02 INFO [routing.RoutingProfile] - [1] Finished at: 2021-05-31 00:38:02.
.
.
.
31-May-2021 00:38:03.236 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/host-manager] has finished in [25] ms
31-May-2021 00:38:03.244 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
31-May-2021 00:38:03.258 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
31-May-2021 00:38:03.265 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 312946 ms
Step 8
Once the graphs are built, perform a simple navigation test by opening
in your browser. This queries your local installation of ORS for driving directions from NDSU's University Village to a point near Washington Elementary School just a few blocks away. Unless Fargo, North Dakota has changed significantly since the time of writing, the link's output should look something like this (emphasis mine):
{"type":"FeatureCollection","metadata":{"attribution":"openrouteservice.org, OpenStreetMap contributors","service":"routing","timestamp":1622423550224,"query":{"coordinates":[[-96.7940189,46.9030355],[-96.7875133,46.9022436]],"profile":"driving-car","format":"json"},"engine":{"version":"6.5.0","build_date":"2021-05-31T00:30:55Z","graph_date":"2021-05-31T00:33:41Z"}},"features":[{"bbox":[-96.794021,46.902243,-96.787412,46.904788],"type":"Feature","properties":{"segments":[{"distance":983.7,"duration":134.7,"steps":[{"distance":17.0,"duration":6.1,"type":11,"instruction":"Head east","name":"-","way_points":[0,1]},{"distance":8.6,"duration":3.1,"type":0,"instruction":"Turn left","name":"-","way_points":[1,2]},{"distance":23.1,"duration":8.3,"type":1,"instruction":"Turn right","name":"-","way_points":[2,3]},{"distance":194.0,"duration":12.7,"type":0,"instruction":"Turn left onto 10th Street North, US 81 BUS","name":"10th Street North, US 81 BUS","way_points":[3,7]},{"distance":458.2,"duration":36.7,"type":1,"instruction":"Turn right onto 19th Avenue North","name":"19th Avenue North","way_points":[7,14]},{"distance":282.7,"duration":67.8,"type":1,"instruction":"Turn right onto Broadway","name":"Broadway","way_points":[14,17]},{"distance":0.0,"duration":0.0,"type":10,"instruction":"Arrive at Broadway, on the right","name":"-","way_points":[17,17]}]}],"way_points":[0,17],"summary":{"distance":983.7,"duration":134.7}},"geometry":{"coordinates":[[-96.794021,46.902967],[-96.793798,46.902963],[-96.793796,46.903041],[-96.793492,46.903044],[-96.79347,46.903867],[-96.793461,46.904229],[-96.793449,46.904686],[-96.793444,46.904788],[-96.792252,46.904778],[-96.791074,46.904779],[-96.790221,46.904781],[-96.789868,46.904781],[-96.788685,46.904783],[-96.788423,46.904783],[-96.787412,46.904785],[-96.787428,46.903997],[-96.787448,46.903002],[-96.787473,46.902243]],"type":"LineString"}}],"bbox":[-96.794021,46.902243,-96.787412,46.904788]}
You can check that the bolded directions provided by ORS correspond to the directions provided by Google Maps. Once you've set up the appropriate ORS container in Docker, you can use ors-local as your data source in VeRoViz. See the relevant VeRoViz documentation for more details. Other maps can be found via Geofabrik and set up using a command similar to that in Step 6.