Skip to content
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

Obtain vehicle routes #92

Open
L0G1C06 opened this issue Aug 9, 2023 · 5 comments
Open

Obtain vehicle routes #92

L0G1C06 opened this issue Aug 9, 2023 · 5 comments

Comments

@L0G1C06
Copy link

L0G1C06 commented Aug 9, 2023

I am using the library to build a map with real addresses. I already got the solution of the best route where I use the longitude and latitude of the addresses of both vehicles and Jobs, but when I go to create the map the only addresses I have from the solution, are exactly the same as I passed. Is it possible for pyvroom to somehow return all the addresses where the algorithm passes to the best route, and not just the Job and vehicle addresses?

@nilsnolde
Copy link
Collaborator

The use of "addresses" is mildly inflationary here 😃 Jokes aside, can you come up with a (minimal) example? I don't understand what

return all the addresses where the algorithm passes to the best route, and not just the Job and vehicle addresses?

is supposed to mean.

@L0G1C06
Copy link
Author

L0G1C06 commented Aug 9, 2023

The addresses in question are the streets, for example, I pass to the algorithm the latitude and longitude of A and C which are two points of Job, however, knowing the route to be taken I know that it must pass through B, but I did not pass to the algorithm the coordinates of B, but I need these 3 co-coordinates to assemble my map, because I suppose the algorithm finds the best path respecting the physical aspect of the streets in reality, or does it simply draw a straight line ignoring the real physical aspect?

@nilsnolde
Copy link
Collaborator

Ahh, you want an actual route out of it. I'm not sure how you'd get that from pyvroom tbh. Upstream vroom has a -g flag for that, which means it'll automatically calculate (and return) a route for each vehicle. In worst case, you'd need to send all the vehicles' locations to the router currently.

@nilsnolde nilsnolde changed the title Real Case Obtain vehicle routes Aug 9, 2023
@L0G1C06
Copy link
Author

L0G1C06 commented Aug 9, 2023

I understand... Do you know any way I could solve this problem without necessarily needing to be using only pyvroom or vroom?

@nilsnolde
Copy link
Collaborator

Well, you already have OSRM running, that's a routing engine which computes the matrix for vroom's input and would also be used for the route computation if pyvroom supports that. So you can just use Python's requests or (making life a bit easier) https://github.com/gis-ops/routingpy, to request a route from OSRM's HTTP API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants