Skip to content

Commit

Permalink
Improvement for bicycle speed for designated path with tracktype
Browse files Browse the repository at this point in the history
  • Loading branch information
ratrun committed Aug 26, 2024
1 parent a506df8 commit 7865e6b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,12 @@ public void handleWayTags(int edgeId, EdgeIntAccess edgeIntAccess, ReaderWay way
speed = PUSHING_SECTION_SPEED;
} else if (pushingSectionsHighways.contains(highwayValue)) {
if (way.hasTag("bicycle", "designated") || way.hasTag("bicycle", "official") || way.hasTag("segregated", "yes")
|| CYCLEWAY_KEYS.stream().anyMatch(k -> way.getTag(k, "").equals("track")))
speed = highwaySpeeds.get("cycleway");
|| CYCLEWAY_KEYS.stream().anyMatch(k -> way.getTag(k, "").equals("track"))) {
if (trackTypeSpeeds.containsKey(trackTypeValue))
speed = trackTypeSpeeds.get(trackTypeValue);
else
speed = highwaySpeeds.get("cycleway");
}
else if (way.hasTag("bicycle", "yes"))
speed = 12;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ public void testSpeedAndPriority() {
way.setTag("surface", "ground");
assertPriorityAndSpeed(SLIGHT_AVOID, PUSHING_SECTION_SPEED, way);

way.clearTags();
way.setTag("highway", "path");
way.setTag("bicycle", "designated");
way.setTag("surface", "mud");
assertPriorityAndSpeed(VERY_NICE, 10, way);

way.clearTags();
way.setTag("highway", "path");
way.setTag("bicycle", "designated");
way.setTag("tracktype", "grade4");
assertPriorityAndSpeed(VERY_NICE, 6, way);

way.clearTags();
way.setTag("highway", "platform");
way.setTag("surface", "paved");
Expand All @@ -199,6 +211,12 @@ public void testSpeedAndPriority() {
way.setTag("surface", "paved");
way.setTag("bicycle", "designated");
assertPriorityAndSpeed(VERY_NICE, cyclewaySpeed, way);
way.clearTags();

way.setTag("highway", "footway");
way.setTag("tracktype", "grade4");
way.setTag("bicycle", "designated");
assertPriorityAndSpeed(VERY_NICE, 6, way);

way.clearTags();
way.setTag("highway", "platform");
Expand Down

0 comments on commit 7865e6b

Please sign in to comment.