Skip to content

Commit

Permalink
Accept keys "cycleway:left" and "cycleway:right" with "opposite" valu…
Browse files Browse the repository at this point in the history
…es for bicycles. graphhopper#280 graphhopper#901
  • Loading branch information
ratrun authored and karussell committed Dec 7, 2016
1 parent 3d9c76f commit 776fdb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,9 @@ protected long handleSpeed(ReaderWay way, double speed, long encoded) {
if ((isOneway || way.hasTag("junction", "roundabout"))
&& !way.hasTag("oneway:bicycle", "no")
&& !way.hasTag("bicycle:backward")
&& !way.hasTag("cycleway", oppositeLanes)) {
&& !way.hasTag("cycleway", oppositeLanes)
&& !way.hasTag("cycleway:left", oppositeLanes)
&& !way.hasTag("cycleway:right", oppositeLanes)) {
boolean isBackward = way.hasTag("oneway", "-1")
|| way.hasTag("oneway:bicycle", "-1")
|| way.hasTag("vehicle:forward", "no")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,14 @@ public void testOneway() {
flags = encoder.handleWayTags(way, encoder.acceptWay(way), 0);
assertTrue(encoder.isForward(flags));
assertTrue(encoder.isBackward(flags));

way.clearTags();
way.setTag("highway", "residential");
way.setTag("oneway", "yes");
way.setTag("cycleway:left", "opposite_lane");
flags = encoder.handleWayTags(way, encoder.acceptWay(way), 0);
assertTrue(encoder.isForward(flags));
assertTrue(encoder.isBackward(flags));
}

@Test
Expand Down

0 comments on commit 776fdb2

Please sign in to comment.