Allow -1.0 as unlimited for default_radius value (#6599)
This commit is contained in:
@@ -13,13 +13,15 @@ bool EngineConfig::IsValid() const
|
||||
return v == -1 || v > limit;
|
||||
};
|
||||
|
||||
const bool limits_valid = unlimited_or_more_than(max_locations_distance_table, 2) &&
|
||||
unlimited_or_more_than(max_locations_map_matching, 2) &&
|
||||
unlimited_or_more_than(max_radius_map_matching, 0) &&
|
||||
unlimited_or_more_than(max_locations_trip, 2) &&
|
||||
unlimited_or_more_than(max_locations_viaroute, 2) &&
|
||||
unlimited_or_more_than(max_results_nearest, 0) &&
|
||||
max_alternatives >= 0;
|
||||
const bool limits_valid =
|
||||
unlimited_or_more_than(max_locations_distance_table, 2) &&
|
||||
unlimited_or_more_than(max_locations_map_matching, 2) &&
|
||||
unlimited_or_more_than(max_radius_map_matching, 0) &&
|
||||
unlimited_or_more_than(max_locations_trip, 2) &&
|
||||
unlimited_or_more_than(max_locations_viaroute, 2) &&
|
||||
unlimited_or_more_than(max_results_nearest, 0) &&
|
||||
(!default_radius.has_value() || unlimited_or_more_than(*default_radius, 0)) &&
|
||||
max_alternatives >= 0;
|
||||
|
||||
return ((use_shared_memory && all_path_are_empty) || (use_mmap && storage_config.IsValid()) ||
|
||||
storage_config.IsValid()) &&
|
||||
|
||||
@@ -181,7 +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.has_value() && *default_radius != -1.0
|
||||
? *default_radius
|
||||
: routing_algorithms::DEFAULT_GPS_PRECISION * RADIUS_MULTIPLIER);
|
||||
}
|
||||
@@ -199,7 +199,7 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
}
|
||||
else
|
||||
{
|
||||
return default_radius.has_value()
|
||||
return default_radius.has_value() && *default_radius != -1.0
|
||||
? *default_radius
|
||||
: routing_algorithms::DEFAULT_GPS_PRECISION * RADIUS_MULTIPLIER;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user