Repository: graphhopper/graphhopper (java)

Issue:
Routing ignores `barrier=yes` with `access=no`
**Describe the bug**
The routing seems to ignore nodes with [`barrier=yes`](https://wiki.openstreetmap.org/wiki/Tag:barrier%3Dyes) and `access=no`. 

**To Reproduce**

Open [this graphhopper.com foot route](https://graphhopper.com/maps/?point=49.868827%2C8.477014&point=49.868426%2C8.473713&locale=en&elevation=true&profile=foot&use_miles=false&selected_detail=Elevation&layer=Omniscale) 
![image](https://user-images.githubusercontent.com/1304610/134823570-50880bd6-e653-4223-bd9a-3963a067fc9b.png)

Note that there [are two  `barrier=yes` `access=no` nodes](https://overpass-turbo.eu/s/1bvM) along this route.
![image](https://user-images.githubusercontent.com/1304610/134823606-abef294e-1603-4187-85b6-b1db02ba930a.png)

**Expected behavior**
No routing should go though any `barrier` node with `access=no`, unless applicable specific permissions are also present.

**System Information**
Graphhopper site



Pull request description:
introduce barrier=yes
Fixes #2400

Patch:
diff --git a/core/src/main/java/com/graphhopper/routing/util/BikeCommonFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/BikeCommonFlagEncoder.java
index dbcb5ef77..c1b02f30e 100644
--- a/core/src/main/java/com/graphhopper/routing/util/BikeCommonFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/BikeCommonFlagEncoder.java
@@ -80,10 +80,10 @@ abstract public class BikeCommonFlagEncoder extends AbstractFlagEncoder {
         oppositeLanes.add("opposite_track");
 
         passByDefaultBarriers.add("gate");
-        // potentialBarriers.add("lift_gate");
         passByDefaultBarriers.add("swing_gate");
         passByDefaultBarriers.add("cattle_grid");
         passByDefaultBarriers.add("chain");
+        passByDefaultBarriers.add("yes"); // see #2400
 
         blockByDefaultBarriers.add("fence");
 
diff --git a/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java
index 0134cbca0..53471613a 100644
--- a/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java
@@ -82,6 +82,7 @@ public class CarFlagEncoder extends AbstractFlagEncoder {
         passByDefaultBarriers.add("swing_gate");
         passByDefaultBarriers.add("cattle_grid");
         passByDefaultBarriers.add("chain");
+        passByDefaultBarriers.add("yes"); // see #2400
 
         blockByDefaultBarriers.add("kissing_gate");
         blockByDefaultBarriers.add("fence");
diff --git a/core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java
index 006d579f8..ae8edfa06 100644
--- a/core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java
@@ -90,10 +90,11 @@ public class FootFlagEncoder extends AbstractFlagEncoder {
         sidewalkValues.add("left");
         sidewalkValues.add("right");
 
-        blockByDefaultBarriers.add("fence");
         passByDefaultBarriers.add("gate");
         passByDefaultBarriers.add("cattle_grid");
         passByDefaultBarriers.add("chain");
+        passByDefaultBarriers.add("yes"); // see #2400
+        blockByDefaultBarriers.add("fence");
 
         safeHighwayTags.add("footway");
         safeHighwayTags.add("path");


Test patch:
diff --git a/core/src/test/java/com/graphhopper/routing/util/CarFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/CarFlagEncoderTest.java
index 1556416a8..2712e0e3d 100644
--- a/core/src/test/java/com/graphhopper/routing/util/CarFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/CarFlagEncoderTest.java
@@ -566,7 +566,7 @@ public class CarFlagEncoderTest {
         // barrier!
         assertTrue(encoder.handleNodeTags(node) > 0);
 
-        CarFlagEncoder tmpEncoder = new CarFlagEncoder(new PMap("block_barriers=false"));
+        CarFlagEncoder tmpEncoder = new CarFlagEncoder();
         EncodingManager.create(tmpEncoder);
 
         // Test if cattle_grid is not blocking
diff --git a/core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java
index 3316aa796..4c73f6c85 100644
--- a/core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java
@@ -371,6 +371,11 @@ public class FootFlagEncoderTest {
         node.setTag("locked", "yes");
         // barrier!
         assertTrue(footEncoder.handleNodeTags(node) > 0);
+
+        node.clearTags();
+        node.setTag("barrier", "yes");
+        node.setTag("access", "no");
+        assertTrue(footEncoder.handleNodeTags(node) > 0);
     }
 
     @Test