diff --git a/features/guidance/roundabout.feature b/features/guidance/roundabout.feature index 079e844bb..b118ab34e 100644 --- a/features/guidance/roundabout.feature +++ b/features/guidance/roundabout.feature @@ -768,3 +768,52 @@ Feature: Basic Roundabout | g,f | 45 90 | gch,edf,edf | depart,roundabout-exit-2,arrive | | g,h | 45 135 | gch,gch,gch | depart,roundabout-exit-1,arrive | | e,e | 90 270 | edf,edf,edf | depart,roundabout-exit-3,arrive | + + Scenario: CCW and CW roundabouts with overlaps + Given the node map + """ + a d g h + + b c j i + f e k l + """ + + And the ways + | nodes | highway | junction | + | abcda | tertiary | roundabout | + | ed | tertiary | | + | af | tertiary | | + | ghijg | tertiary | roundabout | + | kg | tertiary | | + | hl | tertiary | | + + When I route I should get + | from | to | route | turns | distance | + | e | f | ed,af,af | depart,roundabout-exit-1,arrive | 80.1m | + | f | e | af,ed,ed | depart,roundabout-exit-1,arrive | 120.1m | + | k | l | kg,hl,hl | depart,roundabout-exit-1,arrive | 80.1m | + | l | k | hl,kg,kg | depart,roundabout-exit-1,arrive | 120.1m | + + Scenario: Service roundabout with service exits + Given the node map + """ + e + f a d + g b1c + h + """ + + And the ways + | nodes | highway | junction | + | abcda | service | roundabout | + | de | service | | + | af | service | | + | bg | tertiary | | + | bh | service | | + + When I route I should get + | from | to | route | turns | + | 1 | e | abcda,de,de | depart,roundabout-exit-1,arrive | + | 1 | f | abcda,af,af | depart,roundabout-exit-1,arrive | + | 1 | g | abcda,bg,bg | depart,roundabout-exit-1,arrive | + | 1 | h | abcda,bh,bh | depart,roundabout-exit-1,arrive | diff --git a/include/engine/api/route_api.hpp b/include/engine/api/route_api.hpp index 394af1e75..1759c685e 100644 --- a/include/engine/api/route_api.hpp +++ b/include/engine/api/route_api.hpp @@ -167,8 +167,8 @@ class RouteAPI : public BaseAPI */ guidance::trimShortSegments(steps, leg_geometry); - leg.steps = guidance::collapseTurnInstructions(std::move(steps)); - leg.steps = guidance::postProcess(std::move(leg.steps)); + leg.steps = guidance::postProcess(std::move(steps)); + leg.steps = guidance::collapseTurnInstructions(std::move(leg.steps)); leg.steps = guidance::buildIntersections(std::move(leg.steps)); leg.steps = guidance::suppressShortNameSegments(std::move(leg.steps)); leg.steps = guidance::assignRelativeLocations(std::move(leg.steps),