Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unhandled error with no location provided and costs matrix only #826

Closed
jcoupey opened this issue Nov 14, 2022 · 0 comments · Fixed by #836
Closed

Unhandled error with no location provided and costs matrix only #826

jcoupey opened this issue Nov 14, 2022 · 0 comments · Fixed by #836

Comments

@jcoupey
Copy link
Collaborator

jcoupey commented Nov 14, 2022

It is valid to not provide locations and instead use location_index keys to refer to custom matrices row/columns. In that case:

  • when no matrix is provided, we issue a relevant error;
  • if only a durations matrix is provided, it is used for costs too;
  • if only a costs matrix is provided, we should report an error too.

In the latter situation, we still try to compute the durations matrix using a routing engine but the code crashes since no location is provided. Example when changing durations to costs in example_2 in debug mode:

$ vroom -i example_2_costs.json 
vroom: structures/vroom/location.cpp:41: vroom::Coordinate vroom::Location::lat() const: Assertion `this->has_coordinates()' failed.
Aborted (core dumped)

Using v1.12.0, the outcome is a bit cleaner but the error message is totally obscure:

$ vroom_v1.12.0 -i example_2_costs.json 
[Error] bad optional access
{"code":1,"error":"bad optional access"}
@jcoupey jcoupey changed the title Unhandled error with no location index provided and costs matrix only Unhandled error with no location provided and costs matrix only Nov 17, 2022
@jcoupey jcoupey added this to the v1.13.0 milestone Nov 17, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant