-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Valhalla for routing #461
Conversation
I've given this a good start but I'm running into a problem with the current way the response reading goes: vroom/src/routing/http_wrapper.cpp Lines 51 to 62 in 313e1f9
Normally, when all of the response has been received I have no idea if this is related to the server-side internals of Valhalla (prime-server?) or if this is even reproducible on other Valhalla instances. Until further digging I'll probably implement a hack around this based on the |
Hm, weird.. Never had that problem in any other client library (and never saw a Valhalla issue complaining about it), so my assumption is it's probably the way you do the request (although it seems to follow the asio tutorial..). Without having a closer look it's hard to tell for me, I also never build a client app in C++. Maybe @kevinkreiser has a clue off the top of his head, he's one of the main people behind valhalla and mostly built prime_server. |
FWIW the way the query is built is borrowed from what currently works for both OSRM and ORS: vroom/src/routing/valhalla_wrapper.cpp Lines 25 to 48 in 6313ca7
Maybe some more header magic is required... |
I am not entirely sure if I found the correct code that is responsible for this but this line https://github.com/kevinkreiser/prime_server/blob/e7035b586aa6fdb79132a48eef4889da07e9a38a/src/http_protocol.cpp#L272 I tested it locally and |
@krypt-n thanks a lot for investigating and spotting the problem. (Sigh) I did waste a couple hours debugging and working around this... |
This is now pretty much in a working state. I had to take the trouble to merge route legs provided by Valhalla and included https://github.com/vahancho/polylineencoder as a dependency for this purpose. |
Hi I'm a beginner in this. I started Valhalla locally on the computer, but now I'm interested in how to do the integration with Vroom and show it all on a map using Leaflet. Any help would be most welcome, thanks in advance. |
Give me a few minutes, see VROOM-Project/vroom-express#77. I'll add the defaults real quick in a PR, then you can take it from there. You'll need the full stack, i.e. also the repo above, vroom-express. The easiest is a docker-compose setup, where you add vroom docker (contains vroom and vroom-express) and e.g. our valhalla image. Then you can call vroom-express via HTTP which returns the JSON response. You'll need to parse the JSON in JS and build your leaflet objects manually (i.e. the response is not a GeoJSON or similar), Julien's example repo probably helps: https://github.com/VROOM-Project/vroom-frontend. |
Ok, here's the right config.yml: VROOM-Project/vroom-express#78. |
Also, be aware you can't (yet) set custom matrix and/or routing parameters, though we do hope to support that very soon. If you always need the same request parameters you can hardcode them in vroom though and re-compile the source. |
My config.yml file now looks like this. But now when I run npm start, I get the following error "Error: listen EACCES: permission denied 0.0.0.0:3000". How to change host 0.0.0.0 with my host ? |
You're not using it right somehow.. Sorry, but I have no idea which steps you took to get there (apparently not the docker route, but rather host-native installation). Best to think about it again, go through the documentation and either open a new issue in the appropriate repository or rather stackoverflow, as there's nothing wrong with vroom(-express) on a technical side. |
Now I have changed port and launched vroom-express, but I get an error "/ bin / sh: 1: vroom: not found". Sorry for too many questions I am an absolute beginner in this. |
You'll have to check your I'm locking this conversation as it initially only had to do with integrating Valhalla in the core solving engine. @marko-bogdanovic please make sure to post issues in the relevant repository. |
Issue
Fixes #306
Tasks
ValhallaWrapper
class as aHttpWrapper
base classHttpWrapper
more generic to handle stuff that currently works for both OSRM and ORS but not with ValhallaCHANGELOG.md