diff --git a/include/engine/api/table_parameters.hpp b/include/engine/api/table_parameters.hpp index b7b727d69..fbbf6831e 100644 --- a/include/engine/api/table_parameters.hpp +++ b/include/engine/api/table_parameters.hpp @@ -59,7 +59,7 @@ struct TableParameters : public BaseParameters { std::vector sources; std::vector destinations; - double fallback_speed = 0; + double fallback_speed = INVALID_FALLBACK_SPEED; enum class FallbackCoordinateType { diff --git a/include/util/typedefs.hpp b/include/util/typedefs.hpp index afe8350b4..d647a7db7 100644 --- a/include/util/typedefs.hpp +++ b/include/util/typedefs.hpp @@ -116,6 +116,7 @@ static const EdgeDuration MAXIMAL_EDGE_DURATION = std::numeric_limits::max(); static const TurnPenalty INVALID_TURN_PENALTY = std::numeric_limits::max(); static const EdgeDistance INVALID_EDGE_DISTANCE = std::numeric_limits::max(); +static const EdgeDistance INVALID_FALLBACK_SPEED = std::numeric_limits::max(); // FIXME the bitfields we use require a reduced maximal duration, this should be kept consistent // within the code base. For now we have to ensure that we don't case 30 bit to -1 and break any diff --git a/src/engine/plugins/table.cpp b/src/engine/plugins/table.cpp index 4b4dfc6dc..8dc765168 100644 --- a/src/engine/plugins/table.cpp +++ b/src/engine/plugins/table.cpp @@ -96,7 +96,7 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms, } // Scan table for null results - if any exist, replace with distance estimates - if (params.fallback_speed > 0 || params.scale_factor > 0) + if (params.fallback_speed != INVALID_FALLBACK_SPEED || params.scale_factor > 0) { for (std::size_t row = 0; row < num_sources; row++) { @@ -104,7 +104,7 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms, { const auto &table_index = row * num_destinations + column; BOOST_ASSERT(table_index < result_tables_pair.first.size()); - if (params.fallback_speed > 0 && + if (params.fallback_speed != INVALID_FALLBACK_SPEED && params.fallback_speed > 0 && result_tables_pair.first[table_index] == MAXIMAL_EDGE_DURATION) { const auto &source =