diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/BikeCommonAverageSpeedParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/BikeCommonAverageSpeedParser.java index eb598f7d2c..712a261313 100644 --- a/core/src/main/java/com/graphhopper/routing/util/parsers/BikeCommonAverageSpeedParser.java +++ b/core/src/main/java/com/graphhopper/routing/util/parsers/BikeCommonAverageSpeedParser.java @@ -149,8 +149,9 @@ 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"))) { +speed = trackTypeSpeeds.getOrDefault(trackTypeValue, highwaySpeeds.get("cycleway")); + } else if (way.hasTag("bicycle", "yes")) speed = 12; } diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/BikeTagParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/BikeTagParserTest.java index d3088bf3f3..e0e1435c97 100644 --- a/core/src/test/java/com/graphhopper/routing/util/parsers/BikeTagParserTest.java +++ b/core/src/test/java/com/graphhopper/routing/util/parsers/BikeTagParserTest.java @@ -189,6 +189,12 @@ 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("tracktype", "grade4"); + assertPriorityAndSpeed(VERY_NICE, 6, way); + way.clearTags(); way.setTag("highway", "platform"); way.setTag("surface", "paved"); @@ -199,6 +205,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");