Skip to content

Commit

Permalink
Fix for graphhopper#2980, block highway=cycleway with access=no
Browse files Browse the repository at this point in the history
  • Loading branch information
ratrun committed Apr 21, 2024
1 parent 600781f commit 906b364
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 906b364

Please sign in to comment.