Skip to content

Commit

Permalink
Reduce bicycle speed to PUSHING_SECTION_SPEED for the tag vehicle=no
Browse files Browse the repository at this point in the history
  • Loading branch information
ratrun committed Apr 21, 2024
1 parent 906b364 commit e63a10a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ else if (way.hasTag("highway", pushingSectionsHighways)
speed = Math.min(speed, surfaceSpeed);
}
}
if (way.hasTag("vehicle", "no"))
speed = PUSHING_SECTION_SPEED;
return speed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ public void testSpeedAndPriority() {
way.clearTags();
way.setTag("highway", "trunk");
assertPriorityAndSpeed(REACH_DESTINATION, 18, way);

way.clearTags();
way.setTag("highway", "cycleway");
way.setTag("vehicle", "no");
assertPriorityAndSpeed(VERY_NICE, PUSHING_SECTION_SPEED, way);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ public void testHandleCommonWayTags() {
assertFalse(isGetOffBike(way)); // for now only designated will trigger true
way.setTag("foot", "designated");
assertTrue(isGetOffBike(way));

way = new ReaderWay(1);
way.setTag("highway", "cycleway");
way.setTag("vehicle", "no");
assertFalse(isGetOffBike(way));
}

@Test
Expand Down

0 comments on commit e63a10a

Please sign in to comment.