make sure oneway:<class> overrides standard oneway tag

This commit is contained in:
Emil Tin 2012-02-18 21:55:25 +01:00
parent 24e72bc6cc
commit b192fb9403
2 changed files with 26 additions and 19 deletions

View File

@ -173,12 +173,19 @@ public:
} }
if( settings.obeyOneways ) { if( settings.obeyOneways ) {
if( oneway == "no" || oneway == "0" || oneway == "false" || onewayClass == "no" || onewayClass == "0" || onewayClass == "false" || ((settings.accessTag == "bicycle") && (cycleway == "opposite" || cycleway == "opposite_track" || cycleway == "opposite_lane")) ) { if( onewayClass == "yes" || onewayClass == "1" || onewayClass == "true" ) {
w.direction = _Way::oneway;
} else if( onewayClass == "no" || onewayClass == "0" || onewayClass == "false" ) {
w.direction = _Way::bidirectional;
} else if( onewayClass == "-1" ) {
w.direction = _Way::opposite;
} else if( oneway == "no" || oneway == "0" || oneway == "false" ) {
w.direction = _Way::bidirectional;
} else if( settings.accessTag == "bicycle" && (cycleway == "opposite" || cycleway == "opposite_track" || cycleway == "opposite_lane") ) {
w.direction = _Way::bidirectional; w.direction = _Way::bidirectional;
} else if( oneway == "-1") { } else if( oneway == "-1") {
w.direction = _Way::opposite; w.direction = _Way::opposite;
} } else if( oneway == "yes" || oneway == "1" || oneway == "true" || junction == "roundabout" || highway == "motorway_link" || highway == "motorway" ) {
else if( oneway == "yes" || oneway == "1" || oneway == "true" || onewayClass == "yes" || onewayClass == "1" || onewayClass == "true" || junction == "roundabout" || highway == "motorway_link" || highway == "motorway" ) {
w.direction = _Way::oneway; w.direction = _Way::oneway;
} else { } else {
w.direction = _Way::bidirectional; w.direction = _Way::bidirectional;

View File

@ -97,22 +97,22 @@ Feature: Oneway streets
Scenario: Oneway:bicycle should override normal oneways tags Scenario: Oneway:bicycle should override normal oneways tags
Given the speedprofile "bicycle" Given the speedprofile "bicycle"
Then routability should be Then routability should be
| highway | junction | oneway | oneway:bicycle | forw | backw | | highway | oneway:bicycle | oneway | junction | forw | backw |
| primary | | | yes | x | | | primary | yes | | | x | |
| primary | | yes | yes | x | | | primary | yes | yes | | x | |
| primary | | no | yes | x | | | primary | yes | no | | x | |
| primary | | -1 | yes | x | | | primary | yes | -1 | | x | |
| primary | roundabout | | yes | x | | | primary | yes | | roundabout | x | |
| primary | | | no | x | x | | primary | no | | | x | x |
| primary | | yes | no | x | x | | primary | no | yes | | x | x |
| primary | | no | no | x | x | | primary | no | no | | x | x |
| primary | | -1 | no | x | x | | primary | no | -1 | | x | x |
| primary | roundabout | | no | x | x | | primary | no | | roundabout | x | x |
| primary | | | -1 | | x | | primary | -1 | | | | x |
| primary | | yes | -1 | | x | | primary | -1 | yes | | | x |
| primary | | no | -1 | | x | | primary | -1 | no | | | x |
| primary | | -1 | -1 | | x | | primary | -1 | -1 | | | x |
| primary | roundabout | | -1 | | x | | primary | -1 | | roundabout | | x |
@bicycle @bicycle
Scenario: Bicycles and contra flow Scenario: Bicycles and contra flow