From 81ef8ea566aeb5148d1f7793b09a929fab1ec324 Mon Sep 17 00:00:00 2001 From: ratrun Date: Sun, 21 Apr 2024 18:35:10 +0200 Subject: [PATCH] Incorporate review comment --- .../routing/util/parsers/BikeCommonAccessParser.java | 7 +++++-- .../routing/util/parsers/BikeCommonAverageSpeedParser.java | 2 -- .../routing/util/parsers/AbstractBikeTagParserTester.java | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/BikeCommonAccessParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/BikeCommonAccessParser.java index 3c20bf4af97..851bfb6eafc 100644 --- a/core/src/main/java/com/graphhopper/routing/util/parsers/BikeCommonAccessParser.java +++ b/core/src/main/java/com/graphhopper/routing/util/parsers/BikeCommonAccessParser.java @@ -76,10 +76,13 @@ public WayAccess getAccess(ReaderWay way) { return WayAccess.CAN_SKIP; } - // use the way if it is tagged for bikes - if (way.hasTag("bicycle", "dismount") || (way.hasTag("highway", "cycleway") && !way.hasTag("access", "no"))) + // use the way for pushing + if (way.hasTag("bicycle", "dismount") || way.hasTag("vehicle", "no")) return WayAccess.WAY; + if (way.hasTag("access", "no") && (!way.hasTag("bicycle:conditional")) && (!way.hasTag("bicycle", intendedValues))) + return WayAccess.CAN_SKIP; + int firstIndex = way.getFirstIndex(restrictionKeys); if (firstIndex >= 0) { String firstValue = way.getTag(restrictionKeys.get(firstIndex), ""); 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 4072280bc60..05356d37085 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 @@ -211,8 +211,6 @@ else if (way.hasTag("highway", pushingSectionsHighways) speed = Math.min(speed, surfaceSpeed); } } - if (way.hasTag("vehicle", "no")) - speed = PUSHING_SECTION_SPEED; return speed; } diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/AbstractBikeTagParserTester.java b/core/src/test/java/com/graphhopper/routing/util/parsers/AbstractBikeTagParserTester.java index 3f379d7e2e6..30981bcf9a9 100644 --- a/core/src/test/java/com/graphhopper/routing/util/parsers/AbstractBikeTagParserTester.java +++ b/core/src/test/java/com/graphhopper/routing/util/parsers/AbstractBikeTagParserTester.java @@ -192,7 +192,7 @@ public void testAccess() { way.clearTags(); way.setTag("highway", "secondary"); way.setTag("vehicle", "no"); - assertTrue(accessParser.getAccess(way).canSkip()); + assertTrue(accessParser.getAccess(way).isWay()); way.setTag("bicycle", "dismount"); assertTrue(accessParser.getAccess(way).isWay());