VROOM-Project / pyvroom

Vehicle Routing Open-source Optimization Machine
BSD 2-Clause "Simplified" License
69 stars 14 forks source link

Expose `Solution::set_geometry` to get routes #95

Open nilsnolde opened 1 year ago

nilsnolde commented 1 year ago

Currently it seems like we don't expose API to get the final routes when a routing engine was used instead of custom matrices, see #94 . Should be easy, I'll give it a go soon.

jonathf commented 1 year ago

PR created in vroom exposing the geometry attribute. After it is merged, we can expose it in pyvroom.

nilsnolde commented 1 year ago

I was wrong, see https://github.com/VROOM-Project/vroom/pull/972#issuecomment-1686246926

jcoupey commented 1 year ago

Maybe worth providing a bit of context here on what happens upstream. The Input::set_geometry is just the tip of the iceberg here, since it only serves as a way to set the Input::_geometry (private) flag, which simply is a translation of whether the -g option is passed to the vroom command-line.

Then based on that flag, we'll potentially call the add_route_info function from the routing wrappers on every route to get the actual detailed route geometry.

So if you want to get the encoded polyline describing the actual geometry, you want to first make sure Input::_geometry is true, then reach for the Route::geometry values in the solution.