Skip to content

Commit

Permalink
Use surface speed at bridgleways for bicycle profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ratrun committed Aug 23, 2024
1 parent a506df8 commit ea75540
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ else if (way.hasTag("bicycle", "yes"))
speed = PUSHING_SECTION_SPEED; // unknown surface
} else if (way.hasTag("service")) {
speed = highwaySpeeds.get("living_street");
} else if ("track".equals(highwayValue)) {
} else if ("track".equals(highwayValue) ||
"bridleway".equals(highwayValue) ) {
if (surfaceSpeed != null)
speed = surfaceSpeed;
else if (trackTypeSpeeds.containsKey(trackTypeValue))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,23 @@ public void testSpeedAndPriority() {
assertPriorityAndSpeed(VERY_NICE, PUSHING_SECTION_SPEED, way);
way.setTag("bicycle", "yes");
assertPriorityAndSpeed(VERY_NICE, 18, way);

way.clearTags();
way.setTag("highway", "bridleway");
assertPriorityAndSpeed(AVOID, PUSHING_SECTION_SPEED, way);
way.setTag("surface", "gravel");
assertPriorityAndSpeed(AVOID, 12, way);
way.setTag("bicycle", "designated");
assertPriorityAndSpeed(PREFER, 12, way);

way.clearTags();
way.setTag("highway", "path");
assertPriorityAndSpeed(SLIGHT_AVOID, PUSHING_SECTION_SPEED, way);
way.setTag("surface", "gravel");
assertPriorityAndSpeed(SLIGHT_AVOID, PUSHING_SECTION_SPEED, way);
way.setTag("bicycle", "designated");
assertPriorityAndSpeed(VERY_NICE, 12, way);

}

@Test
Expand Down

0 comments on commit ea75540

Please sign in to comment.