pyvroom icon indicating copy to clipboard operation
pyvroom copied to clipboard

Expose `Solution::set_geometry` to get routes

Open nilsnolde opened this issue 2 years ago • 3 comments

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.

nilsnolde avatar Aug 20 '23 21:08 nilsnolde

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

jonathf avatar Aug 21 '23 11:08 jonathf

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

nilsnolde avatar Aug 21 '23 13:08 nilsnolde

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.

jcoupey avatar Aug 21 '23 14:08 jcoupey