From f5fddc135fa66e7cdfd08ed9d921f4faf0fb6627 Mon Sep 17 00:00:00 2001 From: whytro Date: Tue, 21 Mar 2023 01:50:47 +0900 Subject: [PATCH] Apply default_radius behavior to map matching --- src/engine/plugins/match.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/plugins/match.cpp b/src/engine/plugins/match.cpp index 8fe0d78e0..5575e6d17 100644 --- a/src/engine/plugins/match.cpp +++ b/src/engine/plugins/match.cpp @@ -181,6 +181,7 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms, if (tidied.parameters.radiuses.empty()) { search_radiuses.resize(tidied.parameters.coordinates.size(), + default_radius.has_value() ? *default_radius : routing_algorithms::DEFAULT_GPS_PRECISION * RADIUS_MULTIPLIER); } else @@ -189,14 +190,14 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms, std::transform(tidied.parameters.radiuses.begin(), tidied.parameters.radiuses.end(), search_radiuses.begin(), - [](const boost::optional &maybe_radius) { + [default_radius = this->default_radius](const boost::optional &maybe_radius) { if (maybe_radius) { return *maybe_radius * RADIUS_MULTIPLIER; } else { - return routing_algorithms::DEFAULT_GPS_PRECISION * RADIUS_MULTIPLIER; + return default_radius.has_value() ? *default_radius : routing_algorithms::DEFAULT_GPS_PRECISION * RADIUS_MULTIPLIER; } }); }