Repository: graphhopper/graphhopper (java)

Issue:
Issue RoadClassEncoder via EncodedValueLookup when using mtb and motorway
When I set multiple vehicles in the config, including mtb, for example: 
```
graph.flag_encoders: car, mtb
```

My config looks like this:
```
graph.encoded_values: road_class,road_class_link,road_environment,max_speed,road_access
graph.bytes_for_flags: 8
```

If I lookup an encoded value in `InstructionsFromEdges` via `evLookup.getEnumEncodedValue(RoadClass.KEY, RoadClass.class);` I get an EncodedValue as expected.

For motorways this seems returns "other" instead of "motorway". Other road classes seem to be fine. If I only use car it works fine. 

I cross tested with `graph.flag_encoders: car, bike` and this particular issue did not exist. I don't think it's necessarily related to the EncodedValueLookup, but that's how I discovered this.

An example route where this happens is this (I think it happens for all motorways): http://localhost:8989/maps/?point=49.303926%2C8.627148&point=49.302688%2C8.626859

Maybe something is wrong with the number of bits reserved by the mtb encoder?

Pull request:
avoid skipping ways if mixing encoders in OSMRoadClassParser
fixes #1843

The reason why there is a difference for bike vs. mtb: in AcceptWay we use HashMap and getAccess uses the first entry which changes for different String keys. 

 - [x] remove missleading AcceptWay.getAccess

Patch:
diff --git a/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java b/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java
index 5945f9169..bebb2069b 100644
--- a/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java
+++ b/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java
@@ -524,6 +524,7 @@ public class EncodingManager implements EncodedValueLookup {
     public static class AcceptWay {
         private Map<String, Access> accessMap;
         boolean hasAccepted = false;
+        boolean isFerry = false;
 
         public AcceptWay() {
             this.accessMap = new HashMap<>(5);
@@ -541,6 +542,8 @@ public class EncodingManager implements EncodedValueLookup {
             accessMap.put(key, access);
             if (access != Access.CAN_SKIP)
                 hasAccepted = true;
+            if (access == Access.FERRY)
+                isFerry = true;
             return this;
         }
 
@@ -548,14 +551,18 @@ public class EncodingManager implements EncodedValueLookup {
             return accessMap.isEmpty();
         }
 
+        /**
+         * At least one of the entries is not CAN_SKIP
+         */
         public boolean hasAccepted() {
             return hasAccepted;
         }
 
-        public Access getAccess() {
-            if (accessMap.isEmpty())
-                throw new IllegalStateException("Cannot determine Access if map is empty");
-            return accessMap.values().iterator().next();
+        /**
+         * At least one of the entries is FERRY (usually all entries)
+         */
+        public boolean isFerry() {
+            return isFerry;
         }
     }
 
@@ -600,10 +607,8 @@ public class EncodingManager implements EncodedValueLookup {
      */
     public IntsRef handleWayTags(ReaderWay way, AcceptWay acceptWay, IntsRef relationFlags) {
         IntsRef edgeFlags = createEdgeFlags();
-        // return if way or ferry
-        Access access = acceptWay.getAccess();
         for (TagParser parser : edgeTagParsers) {
-            parser.handleWayTags(edgeFlags, way, access, relationFlags);
+            parser.handleWayTags(edgeFlags, way, acceptWay.isFerry(), relationFlags);
         }
         for (AbstractFlagEncoder encoder : edgeEncoders) {
             encoder.handleWayTags(edgeFlags, way, acceptWay.get(encoder.toString()));
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMBikeNetworkTagParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMBikeNetworkTagParser.java
index 9078f7037..2283727e3 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMBikeNetworkTagParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMBikeNetworkTagParser.java
@@ -69,7 +69,7 @@ public class OSMBikeNetworkTagParser implements RelationTagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
         // just copy value into different bit range
         RouteNetwork routeNetwork = transformerRouteRelEnc.getEnum(false, relationFlags);
         bikeRouteEnc.setEnum(false, edgeFlags, routeNetwork);
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMFootNetworkTagParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMFootNetworkTagParser.java
index f03bff430..07d6e7033 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMFootNetworkTagParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMFootNetworkTagParser.java
@@ -23,7 +23,6 @@ import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.EnumEncodedValue;
 import com.graphhopper.routing.profiles.RouteNetwork;
-import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.storage.IntsRef;
 import com.graphhopper.util.Helper;
 
@@ -69,7 +68,7 @@ public class OSMFootNetworkTagParser implements RelationTagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
         // just copy value into different bit range
         RouteNetwork footNetwork = transformerRouteRelEnc.getEnum(false, relationFlags);
         footRouteEnc.setEnum(false, edgeFlags, footNetwork);
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMGetOffBikeParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMGetOffBikeParser.java
index ba4c762a1..c47056616 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMGetOffBikeParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMGetOffBikeParser.java
@@ -36,7 +36,7 @@ public class OSMGetOffBikeParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
         String highway = way.getTag("highway");
         if (!way.hasTag("bicycle", accepted) && (pushBikeHighwayTags.contains(highway) || way.hasTag("railway", "platform"))
                 || "steps".equals(highway) || way.hasTag("bicycle", "dismount")) {
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatParser.java
index 490b6b72c..65d57ebbc 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatParser.java
@@ -5,7 +5,6 @@ import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.EnumEncodedValue;
 import com.graphhopper.routing.profiles.Hazmat;
-import com.graphhopper.routing.util.EncodingManager.Access;
 import com.graphhopper.storage.IntsRef;
 
 import java.util.List;
@@ -24,7 +23,7 @@ public class OSMHazmatParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
         if (readerWay.hasTag("hazmat", "no")) {
             hazEnc.setEnum(false, edgeFlags, Hazmat.NO);
         }
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatTunnelParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatTunnelParser.java
index 49baa5b83..2c9f0787f 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatTunnelParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatTunnelParser.java
@@ -34,7 +34,7 @@ public class OSMHazmatTunnelParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
         if (readerWay.hasTag("hazmat:adr_tunnel_cat", TUNNEL_CATEGORY_NAMES)) {
             HazmatTunnel code = HazmatTunnel.valueOf(readerWay.getTag("hazmat:adr_tunnel_cat"));
             hazTunnelEnc.setEnum(false, edgeFlags, code);
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatWaterParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatWaterParser.java
index 1aca8cbcd..8f71ba093 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatWaterParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMHazmatWaterParser.java
@@ -5,7 +5,6 @@ import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.EnumEncodedValue;
 import com.graphhopper.routing.profiles.HazmatWater;
-import com.graphhopper.routing.util.EncodingManager.Access;
 import com.graphhopper.storage.IntsRef;
 
 import java.util.List;
@@ -25,7 +24,7 @@ public class OSMHazmatWaterParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
         if (readerWay.hasTag("hazmat:water", "no")) {
             hazWaterEnc.setEnum(false, edgeFlags, HazmatWater.NO);
         } else if (readerWay.hasTag("hazmat:water", "permissive")) {
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxAxleLoadParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxAxleLoadParser.java
index 3abfd6914..c975d2114 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxAxleLoadParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxAxleLoadParser.java
@@ -47,7 +47,7 @@ public class OSMMaxAxleLoadParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
         OSMValueExtractor.extractTons(edgeFlags, way, maxAxleLoadEncoder, Collections.singletonList("maxaxleload"));
         return edgeFlags;
     }
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxHeightParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxHeightParser.java
index 7f4ae85c3..0f4d8bca2 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxHeightParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxHeightParser.java
@@ -47,7 +47,7 @@ public class OSMMaxHeightParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
         List<String> heightTags = Arrays.asList("maxheight", "maxheight:physical"/*, the OSM tag "height" is not used for the height of a road, so omit it here! */);
         OSMValueExtractor.extractMeter(edgeFlags, way, heightEncoder, heightTags);
         return edgeFlags;
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxLengthParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxLengthParser.java
index bacc4e8fe..44ba917c5 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxLengthParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxLengthParser.java
@@ -47,7 +47,7 @@ public class OSMMaxLengthParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
         OSMValueExtractor.extractMeter(edgeFlags, way, lengthEncoder, Collections.singletonList("maxlength"));
         return edgeFlags;
     }
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxSpeedParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxSpeedParser.java
index 730210fd6..00e756659 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxSpeedParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxSpeedParser.java
@@ -23,7 +23,6 @@ import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.MaxSpeed;
 import com.graphhopper.routing.util.AbstractFlagEncoder;
-import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.util.spatialrules.SpatialRule;
 import com.graphhopper.storage.IntsRef;
 import com.graphhopper.util.shapes.GHPoint;
@@ -53,7 +52,7 @@ public class OSMMaxSpeedParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
         double maxSpeed = AbstractFlagEncoder.parseSpeed(way.getTag("maxspeed"));
 
         if (maxSpeed < 0) {
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxWeightParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxWeightParser.java
index 228e27593..29c386dc5 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxWeightParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxWeightParser.java
@@ -22,7 +22,6 @@ import com.graphhopper.routing.profiles.DecimalEncodedValue;
 import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.MaxWeight;
-import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.util.parsers.helpers.OSMValueExtractor;
 import com.graphhopper.storage.IntsRef;
 
@@ -36,7 +35,7 @@ public class OSMMaxWeightParser implements TagParser {
     public OSMMaxWeightParser() {
         this(MaxWeight.create());
     }
-    
+
     public OSMMaxWeightParser(DecimalEncodedValue weightEncoder) {
         this.weightEncoder = weightEncoder;
     }
@@ -47,7 +46,7 @@ public class OSMMaxWeightParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
         // do not include OSM tag "height" here as it has completely different meaning (height of peak)
         List<String> weightTags = Arrays.asList("maxweight", "maxgcweight");
         OSMValueExtractor.extractTons(edgeFlags, way, weightEncoder, weightTags);
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxWidthParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxWidthParser.java
index b1be50936..63bc0dd98 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxWidthParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxWidthParser.java
@@ -22,7 +22,6 @@ import com.graphhopper.routing.profiles.DecimalEncodedValue;
 import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.MaxWidth;
-import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.util.parsers.helpers.OSMValueExtractor;
 import com.graphhopper.storage.IntsRef;
 
@@ -36,7 +35,7 @@ public class OSMMaxWidthParser implements TagParser {
     public OSMMaxWidthParser() {
         this(MaxWidth.create());
     }
-    
+
     public OSMMaxWidthParser(DecimalEncodedValue widthEncoder) {
         this.widthEncoder = widthEncoder;
     }
@@ -47,7 +46,7 @@ public class OSMMaxWidthParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
         List<String> widthTags = Arrays.asList("maxwidth", "maxwidth:physical", "width");
         OSMValueExtractor.extractMeter(edgeFlags, way, widthEncoder, widthTags);
         return edgeFlags;
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadAccessParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadAccessParser.java
index c52ef3c57..375f5086c 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadAccessParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadAccessParser.java
@@ -22,7 +22,6 @@ import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.EnumEncodedValue;
 import com.graphhopper.routing.profiles.RoadAccess;
-import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.util.spatialrules.SpatialRule;
 import com.graphhopper.routing.util.spatialrules.TransportationMode;
 import com.graphhopper.storage.IntsRef;
@@ -51,7 +50,7 @@ public class OSMRoadAccessParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
         RoadAccess accessValue = YES;
         RoadAccess tmpAccessValue;
         for (String restriction : restrictions) {
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadClassLinkParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadClassLinkParser.java
index 4e3de6c08..6283eea7f 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadClassLinkParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadClassLinkParser.java
@@ -19,7 +19,6 @@ package com.graphhopper.routing.util.parsers;
 
 import com.graphhopper.reader.ReaderWay;
 import com.graphhopper.routing.profiles.*;
-import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.storage.IntsRef;
 import com.graphhopper.util.Helper;
 
@@ -38,7 +37,7 @@ public class OSMRoadClassLinkParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
         String highwayTag = readerWay.getTag("highway");
         if (!Helper.isEmpty(highwayTag) && highwayTag.endsWith("_link"))
             linkEnc.setBool(false, edgeFlags, true);
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadClassParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadClassParser.java
index 2876b7626..fcaa85135 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadClassParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadClassParser.java
@@ -22,7 +22,6 @@ import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.EnumEncodedValue;
 import com.graphhopper.routing.profiles.RoadClass;
-import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.storage.IntsRef;
 
 import java.util.List;
@@ -43,8 +42,8 @@ public class OSMRoadClassParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, EncodingManager.Access access, IntsRef relationFlags) {
-        if (!access.isWay())
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
+        if (ferry)
             return edgeFlags;
 
         String roadClassTag = readerWay.getTag("highway");
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadEnvironmentParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadEnvironmentParser.java
index 1c9b4f7c1..b1a087b95 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadEnvironmentParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadEnvironmentParser.java
@@ -43,9 +43,9 @@ public class OSMRoadEnvironmentParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
         RoadEnvironment roadEnvironment = OTHER;
-        if (access.isFerry())
+        if (ferry)
             roadEnvironment = FERRY;
         else if (readerWay.hasTag("bridge") && !readerWay.hasTag("bridge", "no"))
             roadEnvironment = BRIDGE;
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoundaboutParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoundaboutParser.java
index 146c5d824..69a896d20 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoundaboutParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoundaboutParser.java
@@ -22,7 +22,6 @@ import com.graphhopper.routing.profiles.BooleanEncodedValue;
 import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.Roundabout;
-import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.storage.IntsRef;
 
 import java.util.List;
@@ -45,8 +44,8 @@ public class OSMRoundaboutParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
-        if (!access.isWay())
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
+        if (ferry)
             return edgeFlags;
         boolean isRoundabout = way.hasTag("junction", "roundabout") || way.hasTag("junction", "circular");
         if (isRoundabout)
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMSurfaceParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMSurfaceParser.java
index 51b0dd73b..7b1bbdadc 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMSurfaceParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMSurfaceParser.java
@@ -48,7 +48,7 @@ public class OSMSurfaceParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
         String surfaceTag = readerWay.getTag("surface");
         Surface surface = Surface.find(surfaceTag);
         if (surface == OTHER && !Helper.isEmpty(surfaceTag)) {
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTollParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTollParser.java
index b90fb42e7..c3f1ef48d 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTollParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTollParser.java
@@ -22,7 +22,6 @@ import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.EnumEncodedValue;
 import com.graphhopper.routing.profiles.Toll;
-import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.storage.IntsRef;
 
 import java.util.List;
@@ -41,8 +40,7 @@ public class OSMTollParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, EncodingManager.Access access,
-                                 IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
         if (readerWay.hasTag("toll", "yes"))
             tollEnc.setEnum(false, edgeFlags, Toll.ALL);
         else if (readerWay.hasTag("toll:hgv", "yes"))
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTrackTypeParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTrackTypeParser.java
index c9e6e5cb9..3f0c4c3c7 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTrackTypeParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTrackTypeParser.java
@@ -22,7 +22,6 @@ import com.graphhopper.routing.profiles.EncodedValue;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.profiles.EnumEncodedValue;
 import com.graphhopper.routing.profiles.TrackType;
-import com.graphhopper.routing.util.EncodingManager.Access;
 import com.graphhopper.storage.IntsRef;
 
 import java.util.List;
@@ -43,9 +42,8 @@ public class OSMTrackTypeParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, Access access,
-                                 IntsRef relationFlags) {
-        if (!access.isWay())
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
+        if (ferry)
             return edgeFlags;
 
         String trackTypeTag = readerWay.getTag("tracktype");
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/SpatialRuleParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/SpatialRuleParser.java
index 32896238c..f015c99f2 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/SpatialRuleParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/SpatialRuleParser.java
@@ -19,7 +19,6 @@ package com.graphhopper.routing.util.parsers;
 
 import com.graphhopper.reader.ReaderWay;
 import com.graphhopper.routing.profiles.*;
-import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.routing.util.spatialrules.SpatialRule;
 import com.graphhopper.routing.util.spatialrules.SpatialRuleLookup;
 import com.graphhopper.storage.IntsRef;
@@ -52,7 +51,7 @@ public class SpatialRuleParser implements TagParser {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags) {
         GHPoint estimatedCenter = way.getTag("estimated_center", null);
         if (estimatedCenter != null) {
             SpatialRule rule = spatialRuleLookup.lookupRule(estimatedCenter);
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/TagParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/TagParser.java
index 30645e8a0..a720aaa12 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/TagParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/TagParser.java
@@ -33,5 +33,5 @@ public interface TagParser {
 
     void createEncodedValues(EncodedValueLookup lookup, List<EncodedValue> registerNewEncodedValue);
 
-    IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, IntsRef relationFlags);
+    IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, boolean ferry, IntsRef relationFlags);
 }


Test patch:
diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatParserTest.java
index 54f5fde6b..9201e7ff8 100644
--- a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatParserTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatParserTest.java
@@ -8,7 +8,6 @@ import com.graphhopper.storage.IntsRef;
 import org.junit.Before;
 import org.junit.Test;
 
-import static com.graphhopper.routing.util.EncodingManager.Access.WAY;
 import static org.junit.Assert.assertEquals;
 
 public class OSMHazmatParserTest {
@@ -31,22 +30,22 @@ public class OSMHazmatParserTest {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
         readerWay.setTag("hazmat", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Hazmat.NO, hazEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("hazmat", "yes");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("hazmat", "designated");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("hazmat", "designated");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef));
     }
 
@@ -54,7 +53,7 @@ public class OSMHazmatParserTest {
     public void testNoNPE() {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef));
     }
 }
\ No newline at end of file
diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatTunnelParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatTunnelParserTest.java
index a2674c516..4ea20c158 100644
--- a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatTunnelParserTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatTunnelParserTest.java
@@ -32,31 +32,31 @@ public class OSMHazmatTunnelParserTest {
         IntsRef intsRef = em.createEdgeFlags();
         ReaderWay readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:adr_tunnel_cat", "A");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.A, hazTunnelEnc.getEnum(false, intsRef));
         
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:adr_tunnel_cat", "B");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.B, hazTunnelEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:adr_tunnel_cat", "C");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.C, hazTunnelEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:adr_tunnel_cat", "D");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.D, hazTunnelEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:adr_tunnel_cat", "E");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.E, hazTunnelEnc.getEnum(false, intsRef));
     }
 
@@ -65,31 +65,31 @@ public class OSMHazmatTunnelParserTest {
         IntsRef intsRef = em.createEdgeFlags();
         ReaderWay readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:tunnel_cat", "A");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.A, hazTunnelEnc.getEnum(false, intsRef));
         
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:tunnel_cat", "B");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.B, hazTunnelEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:tunnel_cat", "C");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.C, hazTunnelEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:tunnel_cat", "D");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.D, hazTunnelEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:tunnel_cat", "E");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.E, hazTunnelEnc.getEnum(false, intsRef));
     }
 
@@ -99,35 +99,35 @@ public class OSMHazmatTunnelParserTest {
         ReaderWay readerWay = new ReaderWay(1);
         readerWay.setTag("tunnel", "yes");
         readerWay.setTag("hazmat:A", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.A, hazTunnelEnc.getEnum(false, intsRef));
         
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("tunnel", "yes");
         readerWay.setTag("hazmat:B", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.B, hazTunnelEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("tunnel", "yes");
         readerWay.setTag("hazmat:C", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.C, hazTunnelEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("tunnel", "yes");
         readerWay.setTag("hazmat:D", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.D, hazTunnelEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay = new ReaderWay(1);
         readerWay.setTag("tunnel", "yes");
         readerWay.setTag("hazmat:E", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.E, hazTunnelEnc.getEnum(false, intsRef));
     }
     
@@ -141,7 +141,7 @@ public class OSMHazmatTunnelParserTest {
         readerWay.setTag("hazmat:C", "no");
         readerWay.setTag("hazmat:D", "no");
         readerWay.setTag("hazmat:E", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.E, hazTunnelEnc.getEnum(false, intsRef));
         
         intsRef = em.createEdgeFlags();
@@ -150,7 +150,7 @@ public class OSMHazmatTunnelParserTest {
         readerWay.setTag("hazmat:A", "no");
         readerWay.setTag("hazmat:B", "no");
         readerWay.setTag("hazmat:C", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.C, hazTunnelEnc.getEnum(false, intsRef));
         
         intsRef = em.createEdgeFlags();
@@ -158,7 +158,7 @@ public class OSMHazmatTunnelParserTest {
         readerWay.setTag("tunnel", "yes");
         readerWay.setTag("hazmat:B", "no");
         readerWay.setTag("hazmat:E", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.E, hazTunnelEnc.getEnum(false, intsRef));
     }
     
@@ -167,7 +167,7 @@ public class OSMHazmatTunnelParserTest {
         IntsRef intsRef = em.createEdgeFlags();
         ReaderWay readerWay = new ReaderWay(1);
         readerWay.setTag("hazmat:B", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.A, hazTunnelEnc.getEnum(false, intsRef));
     }
     
@@ -175,7 +175,7 @@ public class OSMHazmatTunnelParserTest {
     public void testNoNPE() {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatTunnel.A, hazTunnelEnc.getEnum(false, intsRef));
     }
 }
\ No newline at end of file
diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatWaterParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatWaterParserTest.java
index 8e2fad29e..a0c231bc3 100644
--- a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatWaterParserTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMHazmatWaterParserTest.java
@@ -32,17 +32,17 @@ public class OSMHazmatWaterParserTest {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
         readerWay.setTag("hazmat:water", "no");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatWater.NO, hazWaterEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("hazmat:water", "yes");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatWater.YES, hazWaterEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("hazmat:water", "permissive");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatWater.PERMISSIVE, hazWaterEnc.getEnum(false, intsRef));
     }
 
@@ -50,7 +50,7 @@ public class OSMHazmatWaterParserTest {
     public void testNoNPE() {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(HazmatWater.YES, hazWaterEnc.getEnum(false, intsRef));
     }
 }
\ No newline at end of file
diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMMaxAxleLoadParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMMaxAxleLoadParserTest.java
index 2ac80f97c..984980199 100644
--- a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMMaxAxleLoadParserTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMMaxAxleLoadParserTest.java
@@ -8,7 +8,6 @@ import com.graphhopper.storage.IntsRef;
 import org.junit.Before;
 import org.junit.Test;
 
-import static com.graphhopper.routing.util.EncodingManager.Access.WAY;
 import static org.junit.Assert.assertEquals;
 
 public class OSMMaxAxleLoadParserTest {
@@ -31,13 +30,13 @@ public class OSMMaxAxleLoadParserTest {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
         readerWay.setTag("maxaxleload", "11.5");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(11.5, malEnc.getDecimal(false, intsRef), .01);
 
         // if value is beyond the maximum then do not use infinity instead fallback to more restrictive maximum
         intsRef = em.createEdgeFlags();
         readerWay.setTag("maxaxleload", "80");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(malEnc.getMaxDecimal(), malEnc.getDecimal(false, intsRef), .01);
     }
 
@@ -46,17 +45,17 @@ public class OSMMaxAxleLoadParserTest {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
         readerWay.setTag("maxaxleload", "4.8");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(5.0, malEnc.getDecimal(false, intsRef), .01);
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("maxaxleload", "3.6");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(3.5, malEnc.getDecimal(false, intsRef), .01);
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("maxaxleload", "2.4");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(2.5, malEnc.getDecimal(false, intsRef), .01);
     }
 
@@ -64,7 +63,7 @@ public class OSMMaxAxleLoadParserTest {
     public void testNoLimit() {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Double.POSITIVE_INFINITY, malEnc.getDecimal(false, intsRef), .01);
     }
 }
\ No newline at end of file
diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMMaxWeightParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMMaxWeightParserTest.java
index 3786588a1..8ec932aa2 100644
--- a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMMaxWeightParserTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMMaxWeightParserTest.java
@@ -30,13 +30,13 @@ public class OSMMaxWeightParserTest {
         IntsRef intsRef = em.createEdgeFlags();
         readerWay.setTag("highway", "primary");
         readerWay.setTag("maxweight", "5");
-        parser.handleWayTags(intsRef, readerWay, WAY, em.createRelationFlags());
+        parser.handleWayTags(intsRef, readerWay, false, em.createRelationFlags());
         assertEquals(5.0, mwEnc.getDecimal(false, intsRef), .01);
 
         // if value is beyond the maximum then do not use infinity instead fallback to more restrictive maximum
         intsRef = em.createEdgeFlags();
         readerWay.setTag("maxweight", "50");
-        parser.handleWayTags(intsRef, readerWay, WAY, em.createRelationFlags());
+        parser.handleWayTags(intsRef, readerWay, false, em.createRelationFlags());
         assertEquals(mwEnc.getMaxDecimal(), mwEnc.getDecimal(false, intsRef), .01);
     }
 }
\ No newline at end of file
diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMRoadClassParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMRoadClassParserTest.java
index 158a640f7..5364a441d 100644
--- a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMRoadClassParserTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMRoadClassParserTest.java
@@ -8,8 +8,6 @@ import com.graphhopper.storage.IntsRef;
 import org.junit.Before;
 import org.junit.Test;
 
-import static com.graphhopper.routing.util.EncodingManager.Access.FERRY;
-import static com.graphhopper.routing.util.EncodingManager.Access.WAY;
 import static org.junit.Assert.assertEquals;
 
 public class OSMRoadClassParserTest {
@@ -32,17 +30,17 @@ public class OSMRoadClassParserTest {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef edgeFlags = em.createEdgeFlags();
         readerWay.setTag("highway", "primary");
-        parser.handleWayTags(edgeFlags, readerWay, WAY, relFlags);
+        parser.handleWayTags(edgeFlags, readerWay, false, relFlags);
         assertEquals(RoadClass.PRIMARY, rcEnc.getEnum(false, edgeFlags));
 
         edgeFlags = em.createEdgeFlags();
         readerWay.setTag("highway", "unknownstuff");
-        parser.handleWayTags(edgeFlags, readerWay, WAY, relFlags);
+        parser.handleWayTags(edgeFlags, readerWay, false, relFlags);
         assertEquals(RoadClass.OTHER, rcEnc.getEnum(false, edgeFlags));
 
         edgeFlags = em.createEdgeFlags();
         readerWay.setTag("highway", "motorway_link");
-        parser.handleWayTags(edgeFlags, readerWay, WAY, relFlags);
+        parser.handleWayTags(edgeFlags, readerWay, false, relFlags);
         assertEquals(RoadClass.MOTORWAY, rcEnc.getEnum(false, edgeFlags));
     }
 
@@ -51,7 +49,7 @@ public class OSMRoadClassParserTest {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef edgeFlags = em.createEdgeFlags();
         readerWay.setTag("route", "ferry");
-        parser.handleWayTags(edgeFlags, readerWay, FERRY, relFlags);
+        parser.handleWayTags(edgeFlags, readerWay, true, relFlags);
         assertEquals(RoadClass.OTHER, rcEnc.getEnum(false, edgeFlags));
     }
 
@@ -59,7 +57,7 @@ public class OSMRoadClassParserTest {
     public void testNoNPE() {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef edgeFlags = em.createEdgeFlags();
-        parser.handleWayTags(edgeFlags, readerWay, WAY, relFlags);
+        parser.handleWayTags(edgeFlags, readerWay, false, relFlags);
         assertEquals(RoadClass.OTHER, rcEnc.getEnum(false, edgeFlags));
     }
 }
\ No newline at end of file
diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMSurfaceParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMSurfaceParserTest.java
index 6b9042b97..707b238f6 100644
--- a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMSurfaceParserTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMSurfaceParserTest.java
@@ -31,16 +31,16 @@ public class OSMSurfaceParserTest {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
         readerWay.setTag("highway", "primary");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Surface.OTHER, surfaceEnc.getEnum(false, intsRef));
 
         readerWay.setTag("surface", "cobblestone");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Surface.COBBLESTONE, surfaceEnc.getEnum(false, intsRef));
         assertTrue(Surface.COBBLESTONE.ordinal() > Surface.ASPHALT.ordinal());
 
         readerWay.setTag("surface", "earth");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Surface.DIRT, surfaceEnc.getEnum(false, intsRef));
     }
 }
\ No newline at end of file
diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTollParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTollParserTest.java
index b2fac837e..c0e0d1f42 100644
--- a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTollParserTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTollParserTest.java
@@ -8,7 +8,6 @@ import com.graphhopper.storage.IntsRef;
 import org.junit.Before;
 import org.junit.Test;
 
-import static com.graphhopper.routing.util.EncodingManager.Access.WAY;
 import static org.junit.Assert.assertEquals;
 
 public class OSMTollParserTest {
@@ -29,31 +28,31 @@ public class OSMTollParserTest {
         IntsRef relFlags = em.createRelationFlags();
         IntsRef intsRef = em.createEdgeFlags();
         readerWay.setTag("highway", "primary");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Toll.NO, tollEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("highway", "primary");
         readerWay.setTag("toll:hgv", "yes");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Toll.HGV, tollEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("highway", "primary");
         readerWay.setTag("toll:N2", "yes");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Toll.HGV, tollEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("highway", "primary");
         readerWay.setTag("toll:N3", "yes");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Toll.HGV, tollEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("highway", "primary");
         readerWay.setTag("toll", "yes");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Toll.ALL, tollEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
@@ -62,7 +61,7 @@ public class OSMTollParserTest {
         readerWay.setTag("toll:hgv", "yes");
         readerWay.setTag("toll:N2", "yes");
         readerWay.setTag("toll:N3", "yes");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(Toll.ALL, tollEnc.getEnum(false, intsRef));
     }
 }
\ No newline at end of file
diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTrackTypeParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTrackTypeParserTest.java
index 3cb053339..af0b0f2fb 100644
--- a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTrackTypeParserTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTrackTypeParserTest.java
@@ -32,27 +32,27 @@ public class OSMTrackTypeParserTest {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
         readerWay.setTag("tracktype", "grade1");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(TrackType.GRADE1, ttEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("tracktype", "grade2");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(TrackType.GRADE2, ttEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("tracktype", "grade3");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(TrackType.GRADE3, ttEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("tracktype", "grade4");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(TrackType.GRADE4, ttEnc.getEnum(false, intsRef));
 
         intsRef = em.createEdgeFlags();
         readerWay.setTag("tracktype", "grade5");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(TrackType.GRADE5, ttEnc.getEnum(false, intsRef));
     }
 
@@ -61,7 +61,7 @@ public class OSMTrackTypeParserTest {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
         readerWay.setTag("tracktype", "unknownstuff");
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(TrackType.OTHER, ttEnc.getEnum(false, intsRef));
     }
 
@@ -69,7 +69,7 @@ public class OSMTrackTypeParserTest {
     public void testNoNPE() {
         ReaderWay readerWay = new ReaderWay(1);
         IntsRef intsRef = em.createEdgeFlags();
-        parser.handleWayTags(intsRef, readerWay, WAY, relFlags);
+        parser.handleWayTags(intsRef, readerWay, false, relFlags);
         assertEquals(TrackType.OTHER, ttEnc.getEnum(false, intsRef));
     }
 }
diff --git a/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java b/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java
index e399dab89..d7af64e9d 100644
--- a/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java
+++ b/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java
@@ -739,7 +739,7 @@ public class GraphHopperIT {
                 .setCHEnabled(false).setGraphHopperLocation(tmpGraphFile)
                 .setEncodingManager(EncodingManager.start().add(new OSMRoadEnvironmentParser() {
                     @Override
-                    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, EncodingManager.Access access, IntsRef relationFlags) {
+                    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, boolean ferry, IntsRef relationFlags) {
                         // do not change RoadEnvironment to avoid triggering tunnel interpolation - is this a valid use case after #TODONOW?
                         return edgeFlags;
                     }
diff --git a/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java b/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java
index a7272603c..3fefb0324 100644
--- a/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java
+++ b/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java
@@ -948,7 +948,7 @@ public class OSMReaderTest {
                     throw new RuntimeException(e);
                 }
             }
-        }.setEncodingManager(new EncodingManager.Builder().add(new CarFlagEncoder()).build()).
+        }.setEncodingManager(new EncodingManager.Builder().add(new CarFlagEncoder()).add(new BikeFlagEncoder()).build()).
                 setGraphHopperLocation(dir).setCHEnabled(false).
                 importOrLoad();