add test case for ignoring unknown restrictions
This commit is contained in:
parent
d8e444e620
commit
146eb3a20e
@ -430,3 +430,27 @@ Feature: Car - Turn restrictions
|
||||
| a | b | ax,xy,yb,yb |
|
||||
| b | a | yb,xy,ax,ax |
|
||||
|
||||
@specific
|
||||
Scenario: Car - Ignore unrecognized restriction
|
||||
Given the node map
|
||||
| | n | |
|
||||
| w | j | e |
|
||||
| | s | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| sj | yes |
|
||||
| nj | -1 |
|
||||
| wj | -1 |
|
||||
| ej | -1 |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sj | wj | j | yield |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| s | w | sj,wj,wj |
|
||||
| s | n | sj,nj,nj |
|
||||
| s | e | sj,ej,ej |
|
||||
|
||||
|
@ -96,10 +96,13 @@ RestrictionParser::TryParse(const osmium::Relation &relation) const
|
||||
if (value.find("only_") == 0)
|
||||
{
|
||||
is_only_restriction = true;
|
||||
} else if (value.find("no_") == 0)
|
||||
}
|
||||
else if (value.find("no_") == 0)
|
||||
{
|
||||
is_only_restriction = false;
|
||||
} else // unrecognized value type
|
||||
}
|
||||
else // unrecognized value type
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user