Ignore no_*_on_red turn restrictions (#4804)

This commit is contained in:
Michael Krasnyk 2018-01-18 22:28:17 +01:00
parent 72de59ac91
commit 341a5345da
3 changed files with 30 additions and 2 deletions

View File

@ -3,6 +3,7 @@
- Bugfixes:
- FIXED #4704: Fixed regression in bearings reordering introduced in 5.13 [#4704](https://github.com/Project-OSRM/osrm-backend/issues/4704)
- FIXED #4781: Fixed overflow exceptions in percent-encoding parsing
- FIXED #4804: Ignore no_*_on_red turn restrictions
- Guidance:
- CHANGED #4706: Guidance refactoring step to decouple intersection connectivity analysis and turn instructions generation [#4706](https://github.com/Project-OSRM/osrm-backend/pull/4706)
- Profile:

View File

@ -141,6 +141,33 @@ Feature: Car - Turn restrictions
| c | a | cj,aj,aj |
| c | b | cj,bj,bj |
@no_turning
Scenario: Car - Ignore no_*_on_red relations
Given the node map
"""
a
d j b
c
"""
And the ways
| nodes | oneway |
| cj | yes |
| aj | -1 |
| dj | -1 |
| bj | -1 |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | cj | dj | j | no_turn_on_red |
| restriction | cj | bj | j | no_right_turn_on_red |
When I route I should get
| from | to | route |
| c | d | cj,dj,dj |
| c | a | cj,aj,aj |
| c | b | cj,bj,bj |
@only_turning
Scenario: Car - Only left turn
Given the node map

View File

@ -107,12 +107,12 @@ RestrictionParser::TryParse(const osmium::Relation &relation) const
const std::string value(fi_begin->value());
// documented OSM restriction tags start either with only_* or no_*;
// check and return on these values, and ignore unrecognized values
// check and return on these values, and ignore no_*_on_red or unrecognized values
if (value.find("only_") == 0)
{
is_only_restriction = true;
}
else if (value.find("no_") == 0)
else if (value.find("no_") == 0 && !boost::algorithm::ends_with(value, "_on_red"))
{
is_only_restriction = false;
}