Parse table annotations param correctly (#5050)
* fix incorrect parameter parsing for node osrm and add tests * fix boost spirit grammar parsing for annotations * return NotImplemented when distance annotation is requested for MLD in table plugin * update docs
This commit is contained in:
@@ -85,10 +85,18 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
bool request_distance = params.annotations & api::TableParameters::AnnotationsType::Distance;
|
||||
bool request_duration = params.annotations & api::TableParameters::AnnotationsType::Duration;
|
||||
|
||||
if (request_distance && !algorithms.SupportsDistanceAnnotationType())
|
||||
{
|
||||
return Error("NotImplemented",
|
||||
"The distance annotations calculation is not implemented for the chosen "
|
||||
"search algorithm.",
|
||||
result);
|
||||
}
|
||||
|
||||
auto result_tables_pair = algorithms.ManyToManySearch(
|
||||
snapped_phantoms, params.sources, params.destinations, request_distance, request_duration);
|
||||
|
||||
if ((request_duration & result_tables_pair.first.empty()) ||
|
||||
if ((request_duration && result_tables_pair.first.empty()) ||
|
||||
(request_distance && result_tables_pair.second.empty()))
|
||||
{
|
||||
return Error("NoTable", "No table found", result);
|
||||
|
||||
Reference in New Issue
Block a user