I recently found this service and API and think it’s totally awesome. Such a brilliant service. I want to do some quite dense network analysis using routing (and animating the resulting geojson) which would greatly exceed the 2,000 API calls daily limit so am considering a local setup. I have seen there are instructions here although at first glance they look beyond my level of technical competence. https://github.com/GIScience/openrouteservice#installation
Nevertheless I have two questions:
What kind of specs are required (principally RAM and disk space) to run this service locally, using only Scotland as the input file? I have an OKish windows 64 desktop, i7 6700, 16GB ram
How hard is it to install and set the thing up? I’ve never heard of docker or Maven, so there’s probably no point attempting something that’s well beyond my comfort zone. On the other hand I’m fairly good with computers so this could be a chance to learn. I guess it’s a bit like doing mechanics on your car: I could change a battery but I’d never embark on changing a head gasket, even though there’s a book with clear instructions.
Thanks @leungi. It’s actually a bit more complicated than that, and the help information is patchy and difficult to follow if you’re not a programmer. But here are the steps I took to get this working on Windows 10 Pro, hopefully they might be useful to anyone else hitting their head against a brick wall.
In Docker Desktop (you may need to access its settings window from the icon in the system tray: right click → Settings) you need to go into Resources → File Sharing and add the folder where you want your files to live. For me it’s C:\Temp\Docker2 because I messed up the first time.
Now you can go to the windows command prompt (Windows key → cmd) and run this command which does a bunch of stuff behind the scenes which I don’t really understand: docker pull openrouteservice/openrouteservice
Now it’s time to get some openstreetmap data as a pbf file. I used just Scotland [.osm.pbf] which I downloaded from here Geofabrik Download Server I saved that file to here C:\Temp\scotland-latest.osm.pbf
You will obviously need to update the folder paths depending on your file structure, but you ought to be able to do that easily. Just use notepad to find/replace any instance of C:/Temp/Docker2…
THIS IS REALLY IMPORTANT - If the command above worked, the command prompt will return a long string like this 8a405afe2d915f5376ce2e12afd1bc67bd56edc499742701cb656360daff846f
That’s a good sign, and although there’s no progress or confirmation, stuff is happening behind the scenes. Open Task Manager and check that Vmmem is using CPU and doing stuff. I think that docker is builing graphs (edges and nodes of your road network) but it does that silently. So don’t give up at this point or repeat the command. It’s incredibly unclear what’s going on at this stage but I guess once you know you know.
The settings all live in a file called app.config in a directory called conf: C:\Temp\Docker2\conf\app.config
You can open this file in a text editor to change it. For example I increased the max distance from 100km to 1000km. However these settings won’t make any difference until you restart the docker container
To restart the container you first need an id for your container. Back in windows command prompt type docker container ls –aq
Now use the output to amend this command: docker container restart 8a405afe2d91
Good luck! It’s an awesome tool, and it’s free so you can’t really complain, and the support here seems to be excellent. But the help and instructions for newbie windows users like me are poor. These links might be useful as there seems to be documentation in loads of different places:
Thanks @johntdata for that info, it looks really useful
The main problem we have here is that no one from the openrouteservice developer team actually uses Windows - we are all Linux and Mac users so it’s a bit trickier to document getting the setup running with Docker in a Windows environment. But that’s one of the great benefits of having a forum like this - that people like yourself can share their knowledge and experience
Regarding the specs - I have a similar PC (even slightly better processor), but I run into memory problems in Docker (e.g. “Java.lang.OutOfMemoryError: Java heap space - problem when allocating new memory.”).
Am I missing something? Any suggestions to make things work with my configuration?
The first sets the available memory to 1 GB. The seconds sets the maximum memory used to 2 GB. Changing these to higher values should fix your OOM errors - look at the examples above for how to use it.
Over the past days I made some further attempts. Using a VM with 4 CPUs, 64 GB RAM (32 GB of which virtual) and 200 GB disk space, and Xms8g -Xmx24g, I still receive OOM error messages (16 hours after process start):
ors-app | 16 Oct 10:39:28 ERROR [routing.RoutingProfileManager] - java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
I’m immensely grateful for the forum’s help so far, and would really appreciate any pointers what I should do differently to load Europe.
the whole of europe is huge - 25GB for the pbf alone!
As suggested in the configs, we’d recommend having at least twice the RAM available. Also, having this run for a long time is not unexpected.
In your case, I’d suggest trying to build a smaller region first, to check whether everything is running. Leave everything as is and try building a smaller country, like Albania (43MB) or Austria (~600MB).
Remember to change your osm-file-config and to delete your graphs beforehand, otherwise this will run into problems as well.
If this works, you can reduce the memory footprint by changing the stuff affecting RAM listed in our system requirements.
Thanks for your suggestions. I set up a dedicated VM with 32 GB RAM, topped up to 128 GB using Virtual RAM (swap).
I’ve first tried some smaller regions like Africa (5.5 GB) and South America (2.9 GB) and those run fine.
However, I’m starting to run into problems from Asia (11.2 GB) onwards.
Still, I get error messages like below.
Any advice?
ors-app | Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
ors-app | java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x000xca0x010x000x000xc60x030x030xc50x15hAla~0x080xab0xac0x0f0xfa0xa3s0x960x1a0x14?,0xe5l20xa4+0x8a0x170xabk0xfd0x1f0xe40xc50x000x00h0xcc0x140xcc0x130xc0/0xc0+0xc000xc0,0xc00x110xc00x070xc0’0xc0#0xc00x130xc00x090xc0(0xc0$0xc00x140xc00x0a0xcc0x150x000x9e0x000x9f0x00g0x00k0x0030x0090x000x9c0x000x9d0x000x050x000x040x00<0x00=0x00/0x0050xc00x120x000x160x000x0a0x000x030x000x080x000x060x000x140x000x110x000x190x000x170x0020xc00x080x000x120x000x130x000x150x0080x00@0x00f0x00j0x000xa20x000xa30x010x000x0050x000x050x000x050x010x000x000x000x000x000x0a0x000x080x000x060x000x170x000x180x000x190x000x0b0x000x020x010x000x000x0d0x000x0c0x000x0a0x040x010x040x030x020x010x020x030x020x020xff0x010x000x010x000x000x0f0x000x010x01…]. HTTP method names must be tokens
ors-app | at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:434)
ors-app | at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:511)
ors-app | at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
ors-app | at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:831)
ors-app | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1651)
ors-app | at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
ors-app | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
ors-app | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
ors-app | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
ors-app | at java.base/java.lang.Thread.run(Thread.java:829)
ors-app | 31-Oct-2022 20:37:46.679 INFO [http-nio-8080-exec-4] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
this reads like an error with your request - are you sure that this is related to building the graphs?
If so, could you pastebin the rest of the output?
I am finding this a recurring issue with almost all open-source projects. Why is that?
I have spent the last 3 months hunting for a routing solution and I had my high hopes set on OSRM project. I read all tutorials and features and I was liking everything. But when it came the time i wanted to start downloading stuff and explore, I found out the guys had put a big disclaimer in red that "they don’t support Windows and don’t even plan to.
what a bummer!