Add type traits to disable plugins for specific algorithms

This commit is contained in:
Patrick Niklaus
2017-02-25 02:22:17 +00:00
committed by Patrick Niklaus
parent 436b34ffea
commit 922e155763
13 changed files with 179 additions and 45 deletions
+6 -1
View File
@@ -113,6 +113,11 @@ Status MatchPlugin::HandleRequest(const datafacade::ContiguousInternalMemoryData
const api::MatchParameters &parameters,
util::json::Object &json_result) const
{
if (!algorithms.HasMapMatching())
{
return Error("NotImplemented", "Map matching is not implemented for the chosen search algorithm.", json_result);
}
BOOST_ASSERT(parameters.IsValid());
// enforce maximum number of locations for performance reasons
@@ -209,7 +214,7 @@ Status MatchPlugin::HandleRequest(const datafacade::ContiguousInternalMemoryData
// bi-directional
// phantom nodes for possible uturns
sub_routes[index] =
algorithms.ShortestRouting(sub_routes[index].segment_end_coordinates, {false});
algorithms.ShortestPathSearch(sub_routes[index].segment_end_coordinates, {false});
BOOST_ASSERT(sub_routes[index].shortest_path_length != INVALID_EDGE_WEIGHT);
}