From 906b364030f9f168027e50a71df72b71c7be7b81 Mon Sep 17 00:00:00 2001 From: ratrun Date: Sun, 21 Apr 2024 15:54:47 +0200 Subject: [PATCH] Fix for #2980, block highway=cycleway with access=no --- .../routing/util/parsers/BikeCommonAccessParser.java | 2 +- .../graphhopper/routing/util/parsers/BikeTagParserTest.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 885437ca1ce..3c20bf4af97 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 @@ -77,7 +77,7 @@ public WayAccess getAccess(ReaderWay way) { } // use the way if it is tagged for bikes - if (way.hasTag("bicycle", "dismount") || way.hasTag("highway", "cycleway")) + if (way.hasTag("bicycle", "dismount") || (way.hasTag("highway", "cycleway") && !way.hasTag("access", "no"))) return WayAccess.WAY; int firstIndex = way.getFirstIndex(restrictionKeys); 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 39a9d830553..ff18c8846ba 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 @@ -390,6 +390,11 @@ public void testWayAcceptance() { way.setTag("bicycle", "designated"); assertTrue(accessParser.getAccess(way).isWay()); + way.clearTags(); + way.setTag("highway", "cycleway"); + way.setTag("access", "no"); + assertTrue(accessParser.getAccess(way).canSkip()); + way.clearTags(); way.setTag("highway", "motorway"); assertTrue(accessParser.getAccess(way).canSkip());