diff --git a/CHANGELOG.md b/CHANGELOG.md index f82651c1d..92685ab9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ - Infrastructure - BREAKING: Changed the on-disk encoding of the StaticRTree to reduce ramIndex file size. This breaks the **data format** + - Bugfixes + - fixed broken summaries for very short routes + # 5.2.0 RC1 Changes from 5.1.0 diff --git a/features/testbot/summary.feature b/features/testbot/summary.feature index 3290e3c6e..91cb83bab 100644 --- a/features/testbot/summary.feature +++ b/features/testbot/summary.feature @@ -7,7 +7,7 @@ Feature: Basic Routing @smallest Scenario: Checking Given the node map - | a | b | | c | d | e | + | a | b | 1 | c | d | e | And the ways | nodes | @@ -22,6 +22,7 @@ Feature: Basic Routing | e | a | de,cd,bc,ab,ab | de, bc | | a | b | ab,ab | ab | | b | d | bc,cd,cd | bc, cd | + | 1 | c | bc,bc | bc | @smallest Scenario: Check handling empty values diff --git a/include/engine/guidance/assemble_leg.hpp b/include/engine/guidance/assemble_leg.hpp index afa22e888..be75a9b54 100644 --- a/include/engine/guidance/assemble_leg.hpp +++ b/include/engine/guidance/assemble_leg.hpp @@ -35,7 +35,9 @@ struct NamedSegment template -std::array summarizeRoute(const std::vector &route_data) +std::array summarizeRoute(const std::vector &route_data, + const PhantomNode &target_node, + const bool target_traversed_in_reverse) { // merges segments with same name id const auto collapse_segments = [](std::vector &segments) { @@ -71,6 +73,10 @@ std::array summarizeRoute(const std::vector 1) + segments.push_back({target_duration, index++, target_node.name_id}); // this makes sure that the segment with the lowest position comes first std::sort( segments.begin(), segments.end(), [](const NamedSegment &lhs, const NamedSegment &rhs) { @@ -86,6 +92,7 @@ std::array summarizeRoute(const std::vector(route_data); + auto summary_array = detail::summarizeRoute( + route_data, target_node, target_traversed_in_reverse); + if (route_data.empty()) + summary_array[0] = source_node.name_id; BOOST_ASSERT(detail::MAX_USED_SEGMENTS > 0); BOOST_ASSERT(summary_array.begin() != summary_array.end());