diff --git a/plugins/map_matching.hpp b/plugins/map_matching.hpp index 3a589ed25..641d198ca 100644 --- a/plugins/map_matching.hpp +++ b/plugins/map_matching.hpp @@ -108,8 +108,16 @@ template class MapMatchingPlugin : public BasePlugin raw_route.segment_end_coordinates.emplace_back(current_phantom_node_pair); } + if (2 > matched_nodes.size()) + { + reply = http::Reply::StockReply(http::Reply::badRequest); + return; + } + search_engine_ptr->shortest_path( - raw_route.segment_end_coordinates, route_parameters.uturns, raw_route); + raw_route.segment_end_coordinates, + std::vector(raw_route.segment_end_coordinates.size(), true), + raw_route); DescriptorConfig descriptor_config;