Skip to content

Commit

Permalink
Allow counting of service exits on service roundabouts, see #4075
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase authored and Patrick Niklaus committed May 23, 2017
1 parent ac35757 commit 1d26deb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- Added conditional restriction support with `parse-conditional-restrictions=true|false` to osrm-extract. This option saves conditional turn restrictions to the .restrictions file for parsing by contract later. Added `parse-conditionals-from-now=utc time stamp` and `--time-zone-file=/path/to/file` to osrm-contract
- Files
- .osrm.nodes file was renamed to .nbg_nodes and .ebg_nodes was added
- Guidance
- #4075 Changed counting of exits on service roundabouts


# 5.7.1
- Bugfixes
Expand Down
21 changes: 9 additions & 12 deletions features/guidance/roundabout.feature
Original file line number Diff line number Diff line change
Expand Up @@ -796,26 +796,23 @@ Feature: Basic Roundabout

@4030 @4075
Scenario: Service roundabout with service exits
# Counting of service exits must be adjusted in #4075
Given the node map
"""
e
f a d
g b1c
h
g a d f
h b1c e
"""

And the ways
| nodes | highway | junction |
| abcda | service | roundabout |
| de | service | |
| af | service | |
| bg | tertiary | |
| ce | service | |
| df | service | |
| ag | 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 |
| 1 | e | abcda,ce,ce | depart,roundabout-exit-1,arrive |
| 1 | f | abcda,df,df | depart,roundabout-exit-2,arrive |
| 1 | g | abcda,ag,ag | depart,roundabout-exit-3,arrive |
| 1 | h | abcda,bh,bh | depart,roundabout-exit-4,arrive |
9 changes: 7 additions & 2 deletions src/extractor/guidance/roundabout_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,18 @@ Intersection RoundaboutHandler::handleRoundabouts(const RoundaboutType roundabou
return true;
}
return false;
}();
};

if (has_non_ignorable_exit)
if (out_data.road_classification.IsLowPriorityRoadClass() ||
has_non_ignorable_exit())
{
turn.instruction = TurnInstruction::REMAIN_ROUNDABOUT(
roundabout_type, getTurnDirection(turn.angle));
}
else
{ // Suppress exit instructions from normal roundabouts to service roads
turn.instruction = {TurnType::Suppressed, getTurnDirection(turn.angle)};
}
}
}
else
Expand Down

0 comments on commit 1d26deb

Please sign in to comment.