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"}
It is valid to not provide locations and instead use
location_indexkeys to refer to custom matrices row/columns. In that case:durationsmatrix is provided, it is used forcoststoo;costsmatrix is provided, we should report an error too.In the latter situation, we still try to compute the
durationsmatrix using a routing engine but the code crashes since no location is provided. Example when changingdurationstocostsinexample_2in debug mode:Using v1.12.0, the outcome is a bit cleaner but the error message is totally obscure: