Repository: graphhopper/graphhopper
Pull request #1436 (2018-08-09 15:28:24)

Access refactoring
Make access handling for FlagEncoders more readable via a separate and new class (EncodingManager.Access)

Rename AccessValue to Access for SpatialRules

Merge this after #1460  so that we can use this better API in the public TagParser interface instead of "allowed". Probably then also move TagParser out of EncodingManager as it is more related to parsing not encoding the info.


Patch:
diff --git a/core/files/changelog.txt b/core/files/changelog.txt
index 3d349b213..513bb4911 100644
--- a/core/files/changelog.txt
+++ b/core/files/changelog.txt
@@ -1,15 +1,21 @@
 0.12
+    access refactoring #1436 that moves AccessValue into SpatialRule.Access
     refactoring of EncodingManager to use builder pattern. Migration should be simple. Replace new EncodingManager with EncodingManager.create
     EncodingManager.supports renames to hasEncoder
     big refactoring #1447: to increase 64bit limit of flags, make reverse direction handling easier, to allow shared EncodedValues,
         remove reverseFlags method, much simpler property access, simplify FlagEncoder (maybe even deprecate this interface at a later stage)
     moved shp-reader into separate repository: https://github.com/graphhopper/graphhopper-reader-shp    
-    
+
 0.11
-    web resources for dropwizard web framework (no servlets anymore)
+    web resources for dropwizard web framework (no servlets anymore) #1108
     prefix -Dgraphhopper. for command line arguments necessary, see docs/web/quickstart.md or docs/core/quickstart-from-source.md#running--debbuging-with-intellij for details
     delegated reading properties to dropwizard, i.e. the new format yml is not read again in GraphHopper.init
     changed file format for landmarks #1376
+    convert properties into new yml format via: https://gist.github.com/karussell/dbc9b4c455bca98b6a38e4a160e23bf8
+
+0.10
+    introduce path details
+    added handcoded API java client to this repository
 
 0.9
     remove war bundling support #297
diff --git a/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java
index 1961f456d..e1afaf9f9 100644
--- a/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java
@@ -63,9 +63,6 @@ public abstract class AbstractFlagEncoder implements FlagEncoder {
     protected BooleanEncodedValue accessEnc;
     protected BooleanEncodedValue roundaboutEnc;
     protected DecimalEncodedValue speedEncoder;
-    // bit to signal that way is accepted
-    protected long acceptBit;
-    protected long ferryBit;
     protected PMap properties;
     // This value determines the maximal possible speed of any road regardless the maxspeed value
     // lower values allow more compact representation of the routing graph
@@ -173,11 +170,6 @@ public abstract class AbstractFlagEncoder implements FlagEncoder {
         registerNewEncodedValue.add(accessEnc = new SimpleBooleanEncodedValue(prefix + "access", true));
         roundaboutEnc = getBooleanEncodedValue(EncodingManager.ROUNDABOUT);
         encoderBit = 1L << index;
-
-        // define internal flags for parsing
-        index *= 2;
-        acceptBit = 1L << index;
-        ferryBit = 2L << index;
     }
 
     /**
@@ -201,13 +193,13 @@ public abstract class AbstractFlagEncoder implements FlagEncoder {
      *
      * @return the encoded value to indicate if this encoder allows travel or not.
      */
-    public abstract long acceptWay(ReaderWay way);
+    public abstract EncodingManager.Access getAccess(ReaderWay way);
 
     /**
      * Analyze properties of a way and create the edge flags. This method is called in the second
      * parsing step.
      */
-    public abstract IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, long allowed, long relationFlags);
+    public abstract IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, long relationFlags);
 
     /**
      * Parse tags on nodes. Node tags can add to speed (like traffic_signals) where the value is
@@ -527,14 +519,6 @@ public abstract class AbstractFlagEncoder implements FlagEncoder {
         return turnCostEncoder.setValue(0L, (int) costs);
     }
 
-    protected boolean isFerry(long internalFlags) {
-        return (internalFlags & ferryBit) != 0;
-    }
-
-    protected boolean isAccept(long internalFlags) {
-        return (internalFlags & acceptBit) != 0;
-    }
-
     public final DecimalEncodedValue getAverageSpeedEnc() {
         if (speedEncoder == null)
             throw new NullPointerException("FlagEncoder " + toString() + " not yet initialized");
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 fb40eaf08..f989b7ba9 100644
--- a/core/src/main/java/com/graphhopper/routing/util/BikeCommonFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/BikeCommonFlagEncoder.java
@@ -225,71 +225,71 @@ abstract public class BikeCommonFlagEncoder extends AbstractFlagEncoder {
     }
 
     @Override
-    public long acceptWay(ReaderWay way) {
+    public EncodingManager.Access getAccess(ReaderWay way) {
         String highwayValue = way.getTag("highway");
         if (highwayValue == null) {
-            long acceptPotentially = 0;
+            EncodingManager.Access accept = EncodingManager.Access.CAN_SKIP;
 
             if (way.hasTag("route", ferries)) {
                 // if bike is NOT explicitly tagged allow bike but only if foot is not specified
                 String bikeTag = way.getTag("bicycle");
                 if (bikeTag == null && !way.hasTag("foot") || "yes".equals(bikeTag))
-                    acceptPotentially = acceptBit | ferryBit;
+                    accept = EncodingManager.Access.FERRY;
             }
 
             // special case not for all acceptedRailways, only platform
             if (way.hasTag("railway", "platform"))
-                acceptPotentially = acceptBit;
+                accept = EncodingManager.Access.WAY;
 
             if (way.hasTag("man_made", "pier"))
-                acceptPotentially = acceptBit;
+                accept = EncodingManager.Access.WAY;
 
-            if (acceptPotentially != 0) {
+            if (!accept.canSkip()) {
                 if (way.hasTag(restrictions, restrictedValues) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way))
-                    return 0;
-                return acceptPotentially;
+                    return EncodingManager.Access.CAN_SKIP;
+                return accept;
             }
 
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         }
 
         if (!highwaySpeeds.containsKey(highwayValue))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         String sacScale = way.getTag("sac_scale");
         if (sacScale != null) {
             if ((way.hasTag("highway", "cycleway"))
                     && (way.hasTag("sac_scale", "hiking")))
-                return acceptBit;
+                return EncodingManager.Access.WAY;
             if (!isSacScaleAllowed(sacScale))
-                return 0;
+                return EncodingManager.Access.CAN_SKIP;
         }
 
         // use the way if it is tagged for bikes
         if (way.hasTag("bicycle", intendedValues) ||
                 way.hasTag("bicycle", "dismount") ||
                 way.hasTag("highway", "cycleway"))
-            return acceptBit;
+            return EncodingManager.Access.WAY;
 
         // accept only if explicitly tagged for bike usage
         if ("motorway".equals(highwayValue) || "motorway_link".equals(highwayValue))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (way.hasTag("motorroad", "yes"))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         // do not use fords with normal bikes, flagged fords are in included above
         if (isBlockFords() && (way.hasTag("highway", "ford") || way.hasTag("ford")))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         // check access restrictions
         if (way.hasTag(restrictions, restrictedValues) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (getConditionalTagInspector().isPermittedWayConditionallyRestricted(way))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         else
-            return acceptBit;
+            return EncodingManager.Access.WAY;
     }
 
     boolean isSacScaleAllowed(String sacScale) {
@@ -339,12 +339,12 @@ abstract public class BikeCommonFlagEncoder extends AbstractFlagEncoder {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, long allowed, long relationFlags) {
-        if (!isAccept(allowed))
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, long relationFlags) {
+        if (access.canSkip())
             return edgeFlags;
 
         double wayTypeSpeed = getSpeed(way);
-        if (!isFerry(allowed)) {
+        if (!access.isFerry()) {
             wayTypeSpeed = applyMaxSpeed(way, wayTypeSpeed);
             handleSpeed(edgeFlags, way, wayTypeSpeed);
             handleBikeRelated(edgeFlags, way, relationFlags > UNCHANGED.getValue());
diff --git a/core/src/main/java/com/graphhopper/routing/util/Car4WDFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/Car4WDFlagEncoder.java
index 2ab260d60..754fb84a6 100644
--- a/core/src/main/java/com/graphhopper/routing/util/Car4WDFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/Car4WDFlagEncoder.java
@@ -54,44 +54,44 @@ public class Car4WDFlagEncoder extends CarFlagEncoder {
     }
 
     @Override
-    public long acceptWay(ReaderWay way) {
+    public EncodingManager.Access getAccess(ReaderWay way) {
         // TODO: Ferries have conditionals, like opening hours or are closed during some time in the year
         String highwayValue = way.getTag("highway");
         String firstValue = way.getFirstPriorityTag(restrictions);
         if (highwayValue == null) {
             if (way.hasTag("route", ferries)) {
                 if (restrictedValues.contains(firstValue))
-                    return 0;
+                    return EncodingManager.Access.CAN_SKIP;
                 if (intendedValues.contains(firstValue) ||
                         // implied default is allowed only if foot and bicycle is not specified:
                         firstValue.isEmpty() && !way.hasTag("foot") && !way.hasTag("bicycle"))
-                    return acceptBit | ferryBit;
+                    return EncodingManager.Access.FERRY;
             }
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         }
 
         if (!defaultSpeedMap.containsKey(highwayValue))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (way.hasTag("impassable", "yes") || way.hasTag("status", "impassable"))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         // multiple restrictions needs special handling compared to foot and bike, see also motorcycle
         if (!firstValue.isEmpty()) {
             if (restrictedValues.contains(firstValue) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way))
-                return 0;
+                return EncodingManager.Access.CAN_SKIP;
             if (intendedValues.contains(firstValue))
-                return acceptBit;
+                return EncodingManager.Access.WAY;
         }
 
         // do not drive street cars into fords
         if (isBlockFords() && ("ford".equals(highwayValue) || way.hasTag("ford")))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (getConditionalTagInspector().isPermittedWayConditionallyRestricted(way))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         else
-            return acceptBit;
+            return EncodingManager.Access.WAY;
     }
 
     @Override
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 c65bf7ca9..5914f8ef4 100644
--- a/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java
@@ -187,50 +187,50 @@ public class CarFlagEncoder extends AbstractFlagEncoder {
     }
 
     @Override
-    public long acceptWay(ReaderWay way) {
+    public EncodingManager.Access getAccess(ReaderWay way) {
         // TODO: Ferries have conditionals, like opening hours or are closed during some time in the year
         String highwayValue = way.getTag("highway");
         String firstValue = way.getFirstPriorityTag(restrictions);
         if (highwayValue == null) {
             if (way.hasTag("route", ferries)) {
                 if (restrictedValues.contains(firstValue))
-                    return 0;
+                    return EncodingManager.Access.CAN_SKIP;
                 if (intendedValues.contains(firstValue) ||
                         // implied default is allowed only if foot and bicycle is not specified:
                         firstValue.isEmpty() && !way.hasTag("foot") && !way.hasTag("bicycle"))
-                    return acceptBit | ferryBit;
+                    return EncodingManager.Access.FERRY;
             }
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         }
 
         if ("track".equals(highwayValue)) {
             String tt = way.getTag("tracktype");
             if (tt != null && !tt.equals("grade1") && !tt.equals("grade2") && !tt.equals("grade3"))
-                return 0;
+                return EncodingManager.Access.CAN_SKIP;
         }
 
         if (!defaultSpeedMap.containsKey(highwayValue))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (way.hasTag("impassable", "yes") || way.hasTag("status", "impassable"))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         // multiple restrictions needs special handling compared to foot and bike, see also motorcycle
         if (!firstValue.isEmpty()) {
             if (restrictedValues.contains(firstValue) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way))
-                return 0;
+                return EncodingManager.Access.CAN_SKIP;
             if (intendedValues.contains(firstValue))
-                return acceptBit;
+                return EncodingManager.Access.WAY;
         }
 
         // do not drive street cars into fords
         if (isBlockFords() && ("ford".equals(highwayValue) || way.hasTag("ford")))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (getConditionalTagInspector().isPermittedWayConditionallyRestricted(way))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         else
-            return acceptBit;
+            return EncodingManager.Access.WAY;
     }
 
     @Override
@@ -239,11 +239,11 @@ public class CarFlagEncoder extends AbstractFlagEncoder {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, long allowed, long relationFlags) {
-        if (!isAccept(allowed))
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access accept, long relationFlags) {
+        if (accept.canSkip())
             return edgeFlags;
 
-        if (!isFerry(allowed)) {
+        if (!accept.isFerry()) {
             // get assumed speed from highway type
             double speed = getSpeed(way);
             speed = applyMaxSpeed(way, speed);
diff --git a/core/src/main/java/com/graphhopper/routing/util/DataFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/DataFlagEncoder.java
index 99ffe8aac..8583d0490 100644
--- a/core/src/main/java/com/graphhopper/routing/util/DataFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/DataFlagEncoder.java
@@ -20,7 +20,6 @@ package com.graphhopper.routing.util;
 import com.graphhopper.reader.ReaderRelation;
 import com.graphhopper.reader.ReaderWay;
 import com.graphhopper.routing.profiles.*;
-import com.graphhopper.routing.util.spatialrules.AccessValue;
 import com.graphhopper.routing.util.spatialrules.SpatialRule;
 import com.graphhopper.routing.util.spatialrules.SpatialRuleLookup;
 import com.graphhopper.routing.util.spatialrules.TransportationMode;
@@ -37,6 +36,7 @@ import org.slf4j.LoggerFactory;
 import java.util.*;
 import java.util.Map.Entry;
 
+import static com.graphhopper.routing.util.spatialrules.SpatialRule.Access.*;
 import static com.graphhopper.util.Helper.isEmpty;
 import static com.graphhopper.util.Helper.toLowerCase;
 
@@ -155,7 +155,7 @@ public class DataFlagEncoder extends AbstractFlagEncoder {
         restrictions.addAll(Arrays.asList("motorcar", "motor_vehicle", "vehicle", "access"));
 
         // Ordered in increasingly restrictive order
-        // Note: if you update this list you have to update the method getAccessValue too
+        // Note: if you update this list you have to update the method getAccess too
         List<String> accessList = Arrays.asList(
                 //"designated", "permissive", "customers", "delivery",
                 "yes", "destination", "private", "no"
@@ -219,13 +219,13 @@ public class DataFlagEncoder extends AbstractFlagEncoder {
     }
 
     @Override
-    public long acceptWay(ReaderWay way) {
+    public EncodingManager.Access getAccess(ReaderWay way) {
         // important to skip unsupported highways, otherwise too many have to be removed after graph creation
         // and node removal is not yet designed for that
         if (getHighwayValue(way) == 0)
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
-        return acceptBit;
+        return EncodingManager.Access.WAY;
     }
 
     int getHighwayValue(ReaderWay way) {
@@ -261,14 +261,14 @@ public class DataFlagEncoder extends AbstractFlagEncoder {
 
         if (accessValue == 0) {
             // TODO Fix transportation mode when adding other forms of transportation
-            switch (getSpatialRule(way).getAccessValue(way.getTag("highway", ""), TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE)) {
-                case ACCESSIBLE:
+            switch (getSpatialRule(way).getAccess(way.getTag("highway", ""), TransportationMode.MOTOR_VEHICLE, YES)) {
+                case YES:
                     accessValue = accessMap.get("yes");
                     break;
-                case EVENTUALLY_ACCESSIBLE:
+                case CONDITIONAL:
                     accessValue = accessMap.get("destination");
                     break;
-                case NOT_ACCESSIBLE:
+                case NO:
                     accessValue = accessMap.get("no");
                     break;
             }
@@ -277,22 +277,22 @@ public class DataFlagEncoder extends AbstractFlagEncoder {
         return accessValue;
     }
 
-    public AccessValue getAccessValue(IntsRef flags) {
+    public SpatialRule.Access getAccessValue(IntsRef flags) {
         int accessValue = dynAccessEncoder.getInt(false, flags);
         switch (accessValue) {
             case 0:
-                return AccessValue.ACCESSIBLE;
+                return YES;
             // NOT_ACCESSIBLE_KEY
             case 3:
-                return AccessValue.NOT_ACCESSIBLE;
+                return NO;
             default:
-                return AccessValue.EVENTUALLY_ACCESSIBLE;
+                return CONDITIONAL;
         }
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, long allowed, long relationFlags) {
-        if (!isAccept(allowed))
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, long relationFlags) {
+        if (access.canSkip())
             return edgeFlags;
 
         try {
@@ -302,9 +302,8 @@ public class DataFlagEncoder extends AbstractFlagEncoder {
             if (hwValue == 0)
                 return edgeFlags;
 
-            if (isFerry(allowed)) {
+            if (access.isFerry())
                 hwValue = highwayMap.get("ferry");
-            }
 
             highwayEncoder.setInt(false, edgeFlags, hwValue);
 
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 7abb7481c..154863503 100644
--- a/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java
+++ b/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java
@@ -150,10 +150,12 @@ public class EncodingManager implements EncodedValueLookup {
 
         public Builder(int bytes) {
             em = new EncodingManager(bytes);
-            final BooleanEncodedValue roundaboutEnc = new SimpleBooleanEncodedValue("roundabout", false);
+            final BooleanEncodedValue roundaboutEnc = new SimpleBooleanEncodedValue(ROUNDABOUT, false);
             put(roundaboutEnc, new TagParser() {
                 @Override
-                public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, long allowed, long relationFlags) {
+                public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, Access access, long relationFlags) {
+                    if (!access.isWay())
+                        return edgeFlags;
                     boolean isRoundabout = way.hasTag("junction", "roundabout") || way.hasTag("junction", "circular");
                     if (isRoundabout)
                         roundaboutEnc.setBool(false, edgeFlags, true);
@@ -315,14 +317,80 @@ public class EncodingManager implements EncodedValueLookup {
 
     /**
      * Determine whether a way is routable for one of the added encoders.
+     *
+     * @return if at least one encoder consumes the specified way. Additionally the specified acceptWay is changed
+     * to provide more details.
      */
-    public long acceptWay(ReaderWay way) {
-        long includeWay = 0;
+    public boolean acceptWay(ReaderWay way, AcceptWay acceptWay) {
+        if (!acceptWay.isEmpty())
+            throw new IllegalArgumentException("AcceptWay must be empty");
+
         for (AbstractFlagEncoder encoder : edgeEncoders) {
-            includeWay |= encoder.acceptWay(way);
+            acceptWay.put(encoder.toString(), encoder.getAccess(way));
+        }
+        return acceptWay.hasAccepted();
+    }
+
+    public static class AcceptWay {
+        private Map<String, Access> accessMap;
+        boolean hasAccepted = false;
+
+        public AcceptWay() {
+            this.accessMap = new HashMap<>(5);
+        }
+
+        private Access get(String key) {
+            Access res = accessMap.get(key);
+            if (res == null)
+                throw new IllegalArgumentException("Couldn't fetch access value for key " + key);
+
+            return res;
+        }
+
+        private AcceptWay put(String key, Access access) {
+            accessMap.put(key, access);
+            if (access != Access.CAN_SKIP)
+                hasAccepted = true;
+            return this;
+        }
+
+        public boolean isEmpty() {
+            return accessMap.isEmpty();
+        }
+
+        public boolean hasAccepted() {
+            return hasAccepted;
         }
 
-        return includeWay;
+        private boolean has(String key) {
+            return accessMap.containsKey(key);
+        }
+
+        public Access getAccess() {
+            if (accessMap.isEmpty())
+                throw new IllegalStateException("Cannot determine Access if map is empty");
+            return accessMap.values().iterator().next();
+        }
+    }
+
+    public enum Access {
+        WAY, FERRY, OTHER, CAN_SKIP;
+
+        boolean isFerry() {
+            return this.ordinal() == FERRY.ordinal();
+        }
+
+        boolean isWay() {
+            return this.ordinal() == WAY.ordinal();
+        }
+
+        boolean isOther() {
+            return this.ordinal() == OTHER.ordinal();
+        }
+
+        boolean canSkip() {
+            return this.ordinal() == CAN_SKIP.ordinal();
+        }
     }
 
     public long handleRelationTags(long oldRelationFlags, ReaderRelation relation) {
@@ -340,13 +408,15 @@ public class EncodingManager implements EncodedValueLookup {
      *
      * @param relationFlags The preprocessed relation flags is used to influence the way properties.
      */
-    public IntsRef handleWayTags(ReaderWay way, long includeWay, long relationFlags) {
+    public IntsRef handleWayTags(ReaderWay way, AcceptWay acceptWay, long relationFlags) {
         IntsRef edgeFlags = createEdgeFlags();
+        // return if way or ferry
+        Access access = acceptWay.getAccess();
         for (TagParser parser : sharedEncodedValueMap.values()) {
-            parser.handleWayTags(edgeFlags, way, includeWay, relationFlags);
+            parser.handleWayTags(edgeFlags, way, access, relationFlags);
         }
         for (AbstractFlagEncoder encoder : edgeEncoders) {
-            encoder.handleWayTags(edgeFlags, way, includeWay, relationFlags & encoder.getRelBitMask());
+            encoder.handleWayTags(edgeFlags, way, acceptWay.get(encoder.toString()), relationFlags & encoder.getRelBitMask());
         }
         return edgeFlags;
     }
@@ -530,8 +600,4 @@ public class EncodingManager implements EncodedValueLookup {
     public static final String getKey(FlagEncoder encoder, String str) {
         return encoder.toString() + "." + str;
     }
-
-    public interface TagParser {
-        IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, long allowed, long relationFlags);
-    }
 }
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 1ce275d58..d212e2fc0 100644
--- a/core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java
@@ -196,34 +196,33 @@ public class FootFlagEncoder extends AbstractFlagEncoder {
 
     /**
      * Some ways are okay but not separate for pedestrians.
-     * <p>
      */
     @Override
-    public long acceptWay(ReaderWay way) {
+    public EncodingManager.Access getAccess(ReaderWay way) {
         String highwayValue = way.getTag("highway");
         if (highwayValue == null) {
-            long acceptPotentially = 0;
+            EncodingManager.Access acceptPotentially = EncodingManager.Access.CAN_SKIP;
 
             if (way.hasTag("route", ferries)) {
                 String footTag = way.getTag("foot");
                 if (footTag == null || "yes".equals(footTag))
-                    acceptPotentially = acceptBit | ferryBit;
+                    acceptPotentially = EncodingManager.Access.FERRY;
             }
 
             // special case not for all acceptedRailways, only platform
             if (way.hasTag("railway", "platform"))
-                acceptPotentially = acceptBit;
+                acceptPotentially = EncodingManager.Access.WAY;
 
             if (way.hasTag("man_made", "pier"))
-                acceptPotentially = acceptBit;
+                acceptPotentially = EncodingManager.Access.WAY;
 
-            if (acceptPotentially != 0) {
+            if (!acceptPotentially.canSkip()) {
                 if (way.hasTag(restrictions, restrictedValues) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way))
-                    return 0;
+                    return EncodingManager.Access.CAN_SKIP;
                 return acceptPotentially;
             }
 
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         }
 
         String sacScale = way.getTag("sac_scale");
@@ -231,34 +230,34 @@ public class FootFlagEncoder extends AbstractFlagEncoder {
             if (!"hiking".equals(sacScale) && !"mountain_hiking".equals(sacScale)
                     && !"demanding_mountain_hiking".equals(sacScale) && !"alpine_hiking".equals(sacScale))
                 // other scales are too dangerous, see http://wiki.openstreetmap.org/wiki/Key:sac_scale
-                return 0;
+                return EncodingManager.Access.CAN_SKIP;
         }
 
         // no need to evaluate ferries or fords - already included here
         if (way.hasTag("foot", intendedValues))
-            return acceptBit;
+            return EncodingManager.Access.WAY;
 
         // check access restrictions
         if (way.hasTag(restrictions, restrictedValues) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (way.hasTag("sidewalk", sidewalkValues))
-            return acceptBit;
+            return EncodingManager.Access.WAY;
 
         if (!allowedHighwayTags.contains(highwayValue))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (way.hasTag("motorroad", "yes"))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         // do not get our feet wet, "yes" is already included above
         if (isBlockFords() && (way.hasTag("highway", "ford") || way.hasTag("ford")))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (getConditionalTagInspector().isPermittedWayConditionallyRestricted(way))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
-        return acceptBit;
+        return EncodingManager.Access.WAY;
     }
 
     @Override
@@ -281,11 +280,11 @@ public class FootFlagEncoder extends AbstractFlagEncoder {
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, long allowed, long relationFlags) {
-        if (!isAccept(allowed))
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, long relationFlags) {
+        if (access.canSkip())
             return edgeFlags;
 
-        if (!isFerry(allowed)) {
+        if (!access.isFerry()) {
             String sacScale = way.getTag("sac_scale");
             if (sacScale != null) {
                 if ("hiking".equals(sacScale))
diff --git a/core/src/main/java/com/graphhopper/routing/util/HikeFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/HikeFlagEncoder.java
index 6900f8f98..a53fa77c8 100644
--- a/core/src/main/java/com/graphhopper/routing/util/HikeFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/HikeFlagEncoder.java
@@ -66,60 +66,60 @@ public class HikeFlagEncoder extends FootFlagEncoder {
     }
 
     @Override
-    public long acceptWay(ReaderWay way) {
+    public EncodingManager.Access getAccess(ReaderWay way) {
         String highwayValue = way.getTag("highway");
         if (highwayValue == null) {
-            long acceptPotentially = 0;
+            EncodingManager.Access acceptPotentially = EncodingManager.Access.CAN_SKIP;
 
             if (way.hasTag("route", ferries)) {
                 String footTag = way.getTag("foot");
                 if (footTag == null || "yes".equals(footTag))
-                    acceptPotentially = acceptBit | ferryBit;
+                    acceptPotentially = EncodingManager.Access.FERRY;
             }
 
             // special case not for all acceptedRailways, only platform
             if (way.hasTag("railway", "platform"))
-                acceptPotentially = acceptBit;
+                acceptPotentially = EncodingManager.Access.WAY;
 
             if (way.hasTag("man_made", "pier"))
-                acceptPotentially = acceptBit;
+                acceptPotentially = EncodingManager.Access.WAY;
 
-            if (acceptPotentially != 0) {
+            if (!acceptPotentially.canSkip()) {
                 if (way.hasTag(restrictions, restrictedValues) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way))
-                    return 0;
+                    return EncodingManager.Access.CAN_SKIP;
                 return acceptPotentially;
             }
 
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         }
 
         // no need to evaluate ferries or fords - already included here
         if (way.hasTag("foot", intendedValues))
-            return acceptBit;
+            return EncodingManager.Access.WAY;
 
         // check access restrictions
         if (way.hasTag(restrictions, restrictedValues) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         // hiking allows all sac_scale values
         // String sacScale = way.getTag("sac_scale");
         if (way.hasTag("sidewalk", sidewalkValues))
-            return acceptBit;
+            return EncodingManager.Access.WAY;
 
         if (!allowedHighwayTags.contains(highwayValue))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (way.hasTag("motorroad", "yes"))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         // do not get our feet wet, "yes" is already included above
         if (isBlockFords() && (way.hasTag("highway", "ford") || way.hasTag("ford")))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (getConditionalTagInspector().isPermittedWayConditionallyRestricted(way))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         else
-            return acceptBit;
+            return EncodingManager.Access.WAY;
     }
 
     @Override
diff --git a/core/src/main/java/com/graphhopper/routing/util/MotorcycleFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/MotorcycleFlagEncoder.java
index 3f7d52db8..b96c60d49 100644
--- a/core/src/main/java/com/graphhopper/routing/util/MotorcycleFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/MotorcycleFlagEncoder.java
@@ -137,56 +137,56 @@ public class MotorcycleFlagEncoder extends CarFlagEncoder {
     }
 
     @Override
-    public long acceptWay(ReaderWay way) {
+    public EncodingManager.Access getAccess(ReaderWay way) {
         String highwayValue = way.getTag("highway");
         String firstValue = way.getFirstPriorityTag(restrictions);
         if (highwayValue == null) {
             if (way.hasTag("route", ferries)) {
                 if (restrictedValues.contains(firstValue))
-                    return 0;
+                    return EncodingManager.Access.CAN_SKIP;
                 if (intendedValues.contains(firstValue) ||
                         // implied default is allowed only if foot and bicycle is not specified:
                         firstValue.isEmpty() && !way.hasTag("foot") && !way.hasTag("bicycle"))
-                    return acceptBit | ferryBit;
+                    return EncodingManager.Access.FERRY;
             }
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         }
 
         if ("track".equals(highwayValue)) {
             String tt = way.getTag("tracktype");
             if (tt != null && !tt.equals("grade1"))
-                return 0;
+                return EncodingManager.Access.CAN_SKIP;
         }
 
         if (!defaultSpeedMap.containsKey(highwayValue))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (way.hasTag("impassable", "yes") || way.hasTag("status", "impassable"))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (!firstValue.isEmpty()) {
             if (restrictedValues.contains(firstValue) && !getConditionalTagInspector().isRestrictedWayConditionallyPermitted(way))
-                return 0;
+                return EncodingManager.Access.CAN_SKIP;
             if (intendedValues.contains(firstValue))
-                return acceptBit;
+                return EncodingManager.Access.WAY;
         }
 
         // do not drive street cars into fords
         if (isBlockFords() && ("ford".equals(highwayValue) || way.hasTag("ford")))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
 
         if (getConditionalTagInspector().isPermittedWayConditionallyRestricted(way))
-            return 0;
+            return EncodingManager.Access.CAN_SKIP;
         else
-            return acceptBit;
+            return EncodingManager.Access.WAY;
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, long allowed, long priorityFromRelation) {
-        if (!isAccept(allowed))
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access accept, long priorityFromRelation) {
+        if (accept.canSkip())
             return edgeFlags;
 
-        if (!isFerry(allowed)) {
+        if (!accept.isFerry()) {
             // get assumed speed from highway type
             double speed = getSpeed(way);
             speed = applyMaxSpeed(way, speed);
diff --git a/core/src/main/java/com/graphhopper/routing/util/TagParser.java b/core/src/main/java/com/graphhopper/routing/util/TagParser.java
new file mode 100644
index 000000000..6e44682f3
--- /dev/null
+++ b/core/src/main/java/com/graphhopper/routing/util/TagParser.java
@@ -0,0 +1,14 @@
+package com.graphhopper.routing.util;
+
+import com.graphhopper.reader.ReaderWay;
+import com.graphhopper.storage.IntsRef;
+
+/**
+ * This interface defines how parts of the information from 'way' is converted into IntsRef. In
+ * OpenStreetMap one tag key corresponds to one EncodedValue, then you can associate them via 'EncodingManager.put'.
+ * Other situations else like multiple tags into one EncodedValue are possible too. A list of 'TagParser's is currently
+ * aggregated in one 'FlagEncoder' (subject to change).
+ */
+public interface TagParser {
+    IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, long relationFlags);
+}
diff --git a/core/src/main/java/com/graphhopper/routing/util/spatialrules/AccessValue.java b/core/src/main/java/com/graphhopper/routing/util/spatialrules/AccessValue.java
deleted file mode 100644
index 34f1c219a..000000000
--- a/core/src/main/java/com/graphhopper/routing/util/spatialrules/AccessValue.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  Licensed to GraphHopper GmbH under one or more contributor
- *  license agreements. See the NOTICE file distributed with this work for
- *  additional information regarding copyright ownership.
- *
- *  GraphHopper GmbH licenses this file to you under the Apache License,
- *  Version 2.0 (the "License"); you may not use this file except in
- *  compliance with the License. You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package com.graphhopper.routing.util.spatialrules;
-
-/**
- * Enum defining AccessValues
- *
- * @author Robin Boldt
- */
-public enum AccessValue {
-
-    ACCESSIBLE,
-    EVENTUALLY_ACCESSIBLE,
-    NOT_ACCESSIBLE
-
-}
diff --git a/core/src/main/java/com/graphhopper/routing/util/spatialrules/DefaultSpatialRule.java b/core/src/main/java/com/graphhopper/routing/util/spatialrules/DefaultSpatialRule.java
index b1b1b1bed..afe15eb21 100644
--- a/core/src/main/java/com/graphhopper/routing/util/spatialrules/DefaultSpatialRule.java
+++ b/core/src/main/java/com/graphhopper/routing/util/spatialrules/DefaultSpatialRule.java
@@ -49,7 +49,7 @@ public class DefaultSpatialRule extends AbstractSpatialRule {
     }
 
     @Override
-    public AccessValue getAccessValue(String highwayTag, TransportationMode transportationMode, AccessValue _default) {
+    public Access getAccess(String highwayTag, TransportationMode transportationMode, Access _default) {
         // As defined in: https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access-Restriction
         // We tried to find generally forbidden tags
         if (transportationMode == TransportationMode.MOTOR_VEHICLE) {
@@ -59,7 +59,7 @@ public class DefaultSpatialRule extends AbstractSpatialRule {
                 case "cycleway":
                 case "footway":
                 case "pedestrian":
-                    return AccessValue.NOT_ACCESSIBLE;
+                    return Access.NO;
                 default:
                     return _default;
             }
diff --git a/core/src/main/java/com/graphhopper/routing/util/spatialrules/SpatialRule.java b/core/src/main/java/com/graphhopper/routing/util/spatialrules/SpatialRule.java
index fd622feb7..975e64fa9 100644
--- a/core/src/main/java/com/graphhopper/routing/util/spatialrules/SpatialRule.java
+++ b/core/src/main/java/com/graphhopper/routing/util/spatialrules/SpatialRule.java
@@ -31,6 +31,12 @@ import java.util.List;
  */
 public interface SpatialRule {
 
+    enum Access {
+        YES,
+        CONDITIONAL,
+        NO
+    }
+
     /**
      * Return the max speed for a certain highway type. If there is no max speed defined, _default will be returned.
      *
@@ -41,14 +47,14 @@ public interface SpatialRule {
     double getMaxSpeed(String highway, double _default);
 
     /**
-     * Returns the {@link AccessValue} for a certain highway type and transportation mode. If nothing is defined,
+     * Returns the {@link Access} for a certain highway type and transportation mode. If nothing is defined,
      * _default will be returned.
      *
      * @param highwayTag         The highway type, e.g. primary, secondary
      * @param transportationMode The mode of transportation
      * @param _default           The default AccessValue
      */
-    AccessValue getAccessValue(String highwayTag, TransportationMode transportationMode, AccessValue _default);
+    Access getAccess(String highwayTag, TransportationMode transportationMode, Access _default);
 
     /**
      * Returns the borders in which the SpatialRule is valid
@@ -67,8 +73,8 @@ public interface SpatialRule {
         }
 
         @Override
-        public AccessValue getAccessValue(String highwayTag, TransportationMode transportationMode, AccessValue _default) {
-            return AccessValue.ACCESSIBLE;
+        public Access getAccess(String highwayTag, TransportationMode transportationMode, Access _default) {
+            return _default;
         }
 
         @Override
diff --git a/core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/AustriaSpatialRule.java b/core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/AustriaSpatialRule.java
index 3af5b87f0..133c72603 100644
--- a/core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/AustriaSpatialRule.java
+++ b/core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/AustriaSpatialRule.java
@@ -17,7 +17,6 @@
  */
 package com.graphhopper.routing.util.spatialrules.countries;
 
-import com.graphhopper.routing.util.spatialrules.AccessValue;
 import com.graphhopper.routing.util.spatialrules.DefaultSpatialRule;
 import com.graphhopper.routing.util.spatialrules.TransportationMode;
 
@@ -43,13 +42,13 @@ public class AustriaSpatialRule extends DefaultSpatialRule {
     }
 
     @Override
-    public AccessValue getAccessValue(String highwayTag, TransportationMode transportationMode, AccessValue _default) {
+    public Access getAccess(String highwayTag, TransportationMode transportationMode, Access _default) {
         if (transportationMode == TransportationMode.MOTOR_VEHICLE) {
             if (highwayTag.equals("living_street"))
-                return AccessValue.EVENTUALLY_ACCESSIBLE;
+                return Access.CONDITIONAL;
         }
 
-        return super.getAccessValue(highwayTag, transportationMode, _default);
+        return super.getAccess(highwayTag, transportationMode, _default);
     }
 
     @Override
diff --git a/core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/GermanySpatialRule.java b/core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/GermanySpatialRule.java
index 210ab0870..6a8ae5dd5 100644
--- a/core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/GermanySpatialRule.java
+++ b/core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/GermanySpatialRule.java
@@ -17,7 +17,6 @@
  */
 package com.graphhopper.routing.util.spatialrules.countries;
 
-import com.graphhopper.routing.util.spatialrules.AccessValue;
 import com.graphhopper.routing.util.spatialrules.DefaultSpatialRule;
 import com.graphhopper.routing.util.spatialrules.TransportationMode;
 
@@ -50,13 +49,13 @@ public class GermanySpatialRule extends DefaultSpatialRule {
     }
 
     @Override
-    public AccessValue getAccessValue(String highwayTag, TransportationMode transportationMode, AccessValue _default) {
+    public Access getAccess(String highwayTag, TransportationMode transportationMode, Access _default) {
         if (transportationMode == TransportationMode.MOTOR_VEHICLE) {
             if (highwayTag.equals("track"))
-                return AccessValue.EVENTUALLY_ACCESSIBLE;
+                return Access.CONDITIONAL;
         }
 
-        return super.getAccessValue(highwayTag, transportationMode, _default);
+        return super.getAccess(highwayTag, transportationMode, _default);
     }
 
     @Override
diff --git a/core/src/main/java/com/graphhopper/routing/weighting/GenericWeighting.java b/core/src/main/java/com/graphhopper/routing/weighting/GenericWeighting.java
index 0a17c432d..3e696d591 100644
--- a/core/src/main/java/com/graphhopper/routing/weighting/GenericWeighting.java
+++ b/core/src/main/java/com/graphhopper/routing/weighting/GenericWeighting.java
@@ -91,9 +91,9 @@ public class GenericWeighting extends AbstractWeighting {
             return Double.POSITIVE_INFINITY;
 
         switch (gEncoder.getAccessValue(edgeState.getFlags())) {
-            case NOT_ACCESSIBLE:
+            case NO:
                 return Double.POSITIVE_INFINITY;
-            case EVENTUALLY_ACCESSIBLE:
+            case CONDITIONAL:
                 time = time * uncertainAccessiblePenalty;
         }
 
diff --git a/reader-gtfs/src/main/java/com/graphhopper/reader/gtfs/PtFlagEncoder.java b/reader-gtfs/src/main/java/com/graphhopper/reader/gtfs/PtFlagEncoder.java
index 6dc5d474d..5ddcc4151 100644
--- a/reader-gtfs/src/main/java/com/graphhopper/reader/gtfs/PtFlagEncoder.java
+++ b/reader-gtfs/src/main/java/com/graphhopper/reader/gtfs/PtFlagEncoder.java
@@ -21,9 +21,10 @@ package com.graphhopper.reader.gtfs;
 import com.graphhopper.reader.ReaderRelation;
 import com.graphhopper.reader.ReaderWay;
 import com.graphhopper.routing.profiles.EncodedValue;
-import com.graphhopper.routing.profiles.SimpleIntEncodedValue;
 import com.graphhopper.routing.profiles.IntEncodedValue;
+import com.graphhopper.routing.profiles.SimpleIntEncodedValue;
 import com.graphhopper.routing.util.AbstractFlagEncoder;
+import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.storage.IntsRef;
 import com.graphhopper.util.EdgeIteratorState;
 
@@ -57,12 +58,12 @@ public class PtFlagEncoder extends AbstractFlagEncoder {
     }
 
     @Override
-    public long acceptWay(ReaderWay way) {
-        return 0;
+    public EncodingManager.Access getAccess(ReaderWay way) {
+        return EncodingManager.Access.CAN_SKIP;
     }
 
     @Override
-    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, long allowed, long relationFlags) {
+    public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access, long relationFlags) {
         return edgeFlags;
     }
 
diff --git a/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java b/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java
index 81b46c0d4..24367cbb6 100644
--- a/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java
+++ b/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java
@@ -222,9 +222,7 @@ public class OSMReader implements DataReader {
     }
 
     /**
-     * Filter ways but do not analyze properties wayNodes will be filled with participating node
-     * ids.
-     * <p>
+     * Filter ways but do not analyze properties wayNodes will be filled with participating node ids.
      *
      * @return true the current xml entry is a way entry and has nodes
      */
@@ -237,7 +235,7 @@ public class OSMReader implements DataReader {
         if (!item.hasTags())
             return false;
 
-        return encodingManager.acceptWay(item) > 0;
+        return encodingManager.acceptWay(item, new EncodingManager.AcceptWay());
     }
 
     /**
@@ -318,8 +316,8 @@ public class OSMReader implements DataReader {
 
         long wayOsmId = way.getId();
 
-        long includeWay = encodingManager.acceptWay(way);
-        if (includeWay == 0)
+        EncodingManager.AcceptWay acceptWay = new EncodingManager.AcceptWay();
+        if (!encodingManager.acceptWay(way, acceptWay))
             return;
 
         long relationFlags = getRelFlagsMap().get(way.getId());
@@ -350,7 +348,7 @@ public class OSMReader implements DataReader {
             }
         }
 
-        IntsRef edgeFlags = encodingManager.handleWayTags(way, includeWay, relationFlags);
+        IntsRef edgeFlags = encodingManager.handleWayTags(way, acceptWay, relationFlags);
         if (edgeFlags.isEmpty())
             return;
 


Test patch:
diff --git a/core/src/test/java/com/graphhopper/reader/dem/BridgeElevationInterpolatorTest.java b/core/src/test/java/com/graphhopper/reader/dem/BridgeElevationInterpolatorTest.java
index a3c3808e1..213a4279c 100644
--- a/core/src/test/java/com/graphhopper/reader/dem/BridgeElevationInterpolatorTest.java
+++ b/core/src/test/java/com/graphhopper/reader/dem/BridgeElevationInterpolatorTest.java
@@ -18,16 +18,15 @@
 package com.graphhopper.reader.dem;
 
 import com.graphhopper.coll.GHIntHashSet;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
 import com.graphhopper.reader.ReaderWay;
+import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.storage.NodeAccess;
 import com.graphhopper.util.EdgeIteratorState;
 import com.graphhopper.util.Helper;
 import com.graphhopper.util.PointList;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 /**
  * @author Alexey Valikov
@@ -53,13 +52,13 @@ public class BridgeElevationInterpolatorTest extends AbstractEdgeElevationInterp
         // @formatter:off
         /*
          * Graph structure:
-		 * 0-----1-----2-----3-----4
-		 *        \    |    /
-		 *         \   |   /
-		 *          T  T  T
-		 *           \ | /
-		 *            \|/
-		 * 5-----6--T--7--T--8-----9
+         * 0-----1-----2-----3-----4
+         *        \    |    /
+         *         \   |   /
+         *          T  T  T
+         *           \ | /
+         *            \|/
+         * 5-----6--T--7--T--8-----9
          */
         // @formatter:on
         NodeAccess na = graph.getNodeAccess();
@@ -88,19 +87,19 @@ public class BridgeElevationInterpolatorTest extends AbstractEdgeElevationInterp
         edge17.setWayGeometry(
                 Helper.createPointList3D(12, 2, 200, 14, 4, 400, 16, 6, 600, 18, 8, 800));
 
-        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(),normalWay, 1, 0));
-        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), normalWay, 1, 0));
-        edge23.setFlags(dataFlagEncoder.handleWayTags(edge23.getFlags(), normalWay, 1, 0));
-        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), normalWay, 1, 0));
+        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
+        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
+        edge23.setFlags(dataFlagEncoder.handleWayTags(edge23.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
+        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
 
-        edge56.setFlags(dataFlagEncoder.handleWayTags(edge56.getFlags(), normalWay, 1, 0));
-        edge67.setFlags(dataFlagEncoder.handleWayTags(edge67.getFlags(), interpolatableWay, 1, 0));
-        edge78.setFlags(dataFlagEncoder.handleWayTags(edge78.getFlags(), interpolatableWay, 1, 0));
-        edge89.setFlags(dataFlagEncoder.handleWayTags(edge89.getFlags(), normalWay, 1, 0));
+        edge56.setFlags(dataFlagEncoder.handleWayTags(edge56.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
+        edge67.setFlags(dataFlagEncoder.handleWayTags(edge67.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge78.setFlags(dataFlagEncoder.handleWayTags(edge78.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge89.setFlags(dataFlagEncoder.handleWayTags(edge89.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
 
-        edge17.setFlags(dataFlagEncoder.handleWayTags(edge17.getFlags(), interpolatableWay, 1, 0));
-        edge27.setFlags(dataFlagEncoder.handleWayTags(edge27.getFlags(), interpolatableWay, 1, 0));
-        edge37.setFlags(dataFlagEncoder.handleWayTags(edge37.getFlags(), interpolatableWay, 1, 0));
+        edge17.setFlags(dataFlagEncoder.handleWayTags(edge17.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge27.setFlags(dataFlagEncoder.handleWayTags(edge27.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge37.setFlags(dataFlagEncoder.handleWayTags(edge37.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
 
         final GHIntHashSet outerNodeIds = new GHIntHashSet();
         final GHIntHashSet innerNodeIds = new GHIntHashSet();
diff --git a/core/src/test/java/com/graphhopper/reader/dem/TunnelElevationInterpolatorTest.java b/core/src/test/java/com/graphhopper/reader/dem/TunnelElevationInterpolatorTest.java
index 74753aab8..d1d86c73f 100644
--- a/core/src/test/java/com/graphhopper/reader/dem/TunnelElevationInterpolatorTest.java
+++ b/core/src/test/java/com/graphhopper/reader/dem/TunnelElevationInterpolatorTest.java
@@ -18,14 +18,13 @@
 package com.graphhopper.reader.dem;
 
 import com.graphhopper.coll.GHIntHashSet;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
 import com.graphhopper.reader.ReaderWay;
+import com.graphhopper.routing.util.EncodingManager;
 import com.graphhopper.storage.NodeAccess;
 import com.graphhopper.util.EdgeIteratorState;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 /**
  * @author Alexey Valikov
@@ -51,8 +50,8 @@ public class TunnelElevationInterpolatorTest extends AbstractEdgeElevationInterp
         // @formatter:off
         /*
          * Graph structure:
-		 * 0--T--1--T--2     3--T--4
-		 * Tunnel 0-1-2 has a single outer node 2.
+         * 0--T--1--T--2     3--T--4
+         * Tunnel 0-1-2 has a single outer node 2.
          */
         // @formatter:on
         NodeAccess na = graph.getNodeAccess();
@@ -66,9 +65,9 @@ public class TunnelElevationInterpolatorTest extends AbstractEdgeElevationInterp
         EdgeIteratorState edge12 = graph.edge(1, 2, 10, true);
         EdgeIteratorState edge34 = graph.edge(3, 4, 10, true);
 
-        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), interpolatableWay, 1, 0));
-        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), interpolatableWay, 1, 0));
-        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), interpolatableWay, 1, 0));
+        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
 
         final GHIntHashSet outerNodeIds = new GHIntHashSet();
         final GHIntHashSet innerNodeIds = new GHIntHashSet();
@@ -90,8 +89,8 @@ public class TunnelElevationInterpolatorTest extends AbstractEdgeElevationInterp
 
         // @formatter:off
         /*
-		 * Graph structure:
-		 * 0--T--1--T--2-----3--T--4
+         * Graph structure:
+         * 0--T--1--T--2-----3--T--4
          */
         // @formatter:on
         NodeAccess na = graph.getNodeAccess();
@@ -106,10 +105,10 @@ public class TunnelElevationInterpolatorTest extends AbstractEdgeElevationInterp
         EdgeIteratorState edge23 = graph.edge(2, 3, 10, true);
         EdgeIteratorState edge34 = graph.edge(3, 4, 10, true);
 
-        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), interpolatableWay, 1, 0));
-        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), interpolatableWay, 1, 0));
-        edge23.setFlags(dataFlagEncoder.handleWayTags(edge23.getFlags(), normalWay, 1, 0));
-        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), interpolatableWay, 1, 0));
+        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge23.setFlags(dataFlagEncoder.handleWayTags(edge23.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
+        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
 
         final GHIntHashSet outerNodeIds = new GHIntHashSet();
         final GHIntHashSet innerNodeIds = new GHIntHashSet();
@@ -131,8 +130,8 @@ public class TunnelElevationInterpolatorTest extends AbstractEdgeElevationInterp
 
         // @formatter:off
         /*
-		 * Graph structure:
-		 * 0-----1--T--2--T--3-----4
+         * Graph structure:
+         * 0-----1--T--2--T--3-----4
          */
         // @formatter:on
         NodeAccess na = graph.getNodeAccess();
@@ -147,10 +146,10 @@ public class TunnelElevationInterpolatorTest extends AbstractEdgeElevationInterp
         EdgeIteratorState edge23 = graph.edge(2, 3, 10, true);
         EdgeIteratorState edge34 = graph.edge(3, 4, 10, true);
 
-        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), normalWay, 1, 0));
-        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), interpolatableWay, 1, 0));
-        edge23.setFlags(dataFlagEncoder.handleWayTags(edge23.getFlags(), interpolatableWay, 1, 0));
-        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), normalWay, 1, 0));
+        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
+        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge23.setFlags(dataFlagEncoder.handleWayTags(edge23.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
 
         final GHIntHashSet outerNodeIds = new GHIntHashSet();
         final GHIntHashSet innerNodeIds = new GHIntHashSet();
@@ -172,14 +171,14 @@ public class TunnelElevationInterpolatorTest extends AbstractEdgeElevationInterp
 
         // @formatter:off
         /*
-		 * Graph structure:
-		 * 0-----1--T--2--T--3-----4
-		 *             |
-		 *             |
-		 *             T
-		 *             |
-		 *             |
-		 *             5--T--6-----7
+         * Graph structure:
+         * 0-----1--T--2--T--3-----4
+         *             |
+         *             |
+         *             T
+         *             |
+         *             |
+         *             5--T--6-----7
          */
         // @formatter:on
         NodeAccess na = graph.getNodeAccess();
@@ -200,13 +199,13 @@ public class TunnelElevationInterpolatorTest extends AbstractEdgeElevationInterp
         EdgeIteratorState edge56 = graph.edge(5, 6, 10, true);
         EdgeIteratorState edge67 = graph.edge(6, 7, 10, true);
 
-        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), normalWay, 1, 0));
-        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), interpolatableWay, 1, 0));
-        edge23.setFlags(dataFlagEncoder.handleWayTags(edge23.getFlags(), interpolatableWay, 1, 0));
-        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), normalWay, 1, 0));
-        edge25.setFlags(dataFlagEncoder.handleWayTags(edge25.getFlags(), interpolatableWay, 1, 0));
-        edge56.setFlags(dataFlagEncoder.handleWayTags(edge56.getFlags(), interpolatableWay, 1, 0));
-        edge67.setFlags(dataFlagEncoder.handleWayTags(edge67.getFlags(), normalWay, 1, 0));
+        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
+        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge23.setFlags(dataFlagEncoder.handleWayTags(edge23.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
+        edge25.setFlags(dataFlagEncoder.handleWayTags(edge25.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge56.setFlags(dataFlagEncoder.handleWayTags(edge56.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge67.setFlags(dataFlagEncoder.handleWayTags(edge67.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
 
         final GHIntHashSet outerNodeIds = new GHIntHashSet();
         final GHIntHashSet innerNodeIds = new GHIntHashSet();
@@ -231,14 +230,14 @@ public class TunnelElevationInterpolatorTest extends AbstractEdgeElevationInterp
 
         // @formatter:off
         /*
-            * Graph structure:
-            * 0-----1--T--2--T--3-----4
-            *             |
-            *             |
-            *             T
-            *             |
-            *             |
-            * 5-----6--T--7--T--8-----9
+         * Graph structure:
+         * 0-----1--T--2--T--3-----4
+         *             |
+         *             |
+         *             T
+         *             |
+         *             |
+         * 5-----6--T--7--T--8-----9
          */
         // @formatter:on
         NodeAccess na = graph.getNodeAccess();
@@ -263,17 +262,17 @@ public class TunnelElevationInterpolatorTest extends AbstractEdgeElevationInterp
         EdgeIteratorState edge89 = graph.edge(8, 9, 10, true);
         EdgeIteratorState edge27 = graph.edge(2, 7, 10, true);
 
-        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), normalWay, 1, 0));
-        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), interpolatableWay, 1, 0));
-        edge23.setFlags(dataFlagEncoder.handleWayTags(edge23.getFlags(), interpolatableWay, 1, 0));
-        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), normalWay, 1, 0));
+        edge01.setFlags(dataFlagEncoder.handleWayTags(edge01.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
+        edge12.setFlags(dataFlagEncoder.handleWayTags(edge12.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge23.setFlags(dataFlagEncoder.handleWayTags(edge23.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge34.setFlags(dataFlagEncoder.handleWayTags(edge34.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
 
-        edge56.setFlags(dataFlagEncoder.handleWayTags(edge56.getFlags(), normalWay, 1, 0));
-        edge67.setFlags(dataFlagEncoder.handleWayTags(edge67.getFlags(), interpolatableWay, 1, 0));
-        edge78.setFlags(dataFlagEncoder.handleWayTags(edge78.getFlags(), interpolatableWay, 1, 0));
-        edge89.setFlags(dataFlagEncoder.handleWayTags(edge89.getFlags(), normalWay, 1, 0));
+        edge56.setFlags(dataFlagEncoder.handleWayTags(edge56.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
+        edge67.setFlags(dataFlagEncoder.handleWayTags(edge67.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge78.setFlags(dataFlagEncoder.handleWayTags(edge78.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
+        edge89.setFlags(dataFlagEncoder.handleWayTags(edge89.getFlags(), normalWay, EncodingManager.Access.WAY, 0));
 
-        edge27.setFlags(dataFlagEncoder.handleWayTags(edge27.getFlags(), interpolatableWay, 1, 0));
+        edge27.setFlags(dataFlagEncoder.handleWayTags(edge27.getFlags(), interpolatableWay, EncodingManager.Access.WAY, 0));
 
         final GHIntHashSet outerNodeIds = new GHIntHashSet();
         final GHIntHashSet innerNodeIds = new GHIntHashSet();
diff --git a/core/src/test/java/com/graphhopper/routing/PathTest.java b/core/src/test/java/com/graphhopper/routing/PathTest.java
index 1843428e9..a25551e61 100644
--- a/core/src/test/java/com/graphhopper/routing/PathTest.java
+++ b/core/src/test/java/com/graphhopper/routing/PathTest.java
@@ -801,9 +801,12 @@ public class PathTest {
         ReaderWay w = new ReaderWay(1);
         w.setTag("highway", "tertiary");
 
-        g.edge(1, 2, 5, true).setFlags(dataFlagEncoder.handleWayTags(dataFlagManager.createEdgeFlags(), w, 1, 0));
-        g.edge(2, 4, 5, true).setFlags(dataFlagEncoder.handleWayTags(dataFlagManager.createEdgeFlags(), w, 1, 0));
-        g.edge(2, 3, 5, true).setFlags(dataFlagEncoder.handleWayTags(dataFlagManager.createEdgeFlags(), w, 1, 0));
+        g.edge(1, 2, 5, true).setFlags(dataFlagEncoder.handleWayTags(dataFlagManager.createEdgeFlags(), w,
+                EncodingManager.Access.WAY, 0));
+        g.edge(2, 4, 5, true).setFlags(dataFlagEncoder.handleWayTags(dataFlagManager.createEdgeFlags(), w,
+                EncodingManager.Access.WAY, 0));
+        g.edge(2, 3, 5, true).setFlags(dataFlagEncoder.handleWayTags(dataFlagManager.createEdgeFlags(), w,
+                EncodingManager.Access.WAY, 0));
 
         Path p = new Dijkstra(g, new GenericWeighting(dataFlagEncoder, new HintsMap()), TraversalMode.NODE_BASED).calcPath(1, 3);
         assertTrue(p.isFound());
@@ -890,17 +893,19 @@ public class PathTest {
 
         EdgeIteratorState tmpEdge;
         tmpEdge = g.edge(1, 2, 5, true).setName("1-2");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        EncodingManager.AcceptWay map = new EncodingManager.AcceptWay();
+        assertTrue(carManager.acceptWay(w, map));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
         tmpEdge = g.edge(4, 5, 5, true).setName("4-5");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
 
         w.setTag("maxspeed", "100");
         tmpEdge = g.edge(2, 3, 5, true).setName("2-3");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
 
         w.setTag("maxspeed", "10");
         tmpEdge = g.edge(3, 4, 10, true).setName("3-4");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
 
         return g;
     }
diff --git a/core/src/test/java/com/graphhopper/routing/profiles/DecimalEncodedValueTest.java b/core/src/test/java/com/graphhopper/routing/profiles/DecimalEncodedValueTest.java
index 52cbfac70..eb950dc2c 100644
--- a/core/src/test/java/com/graphhopper/routing/profiles/DecimalEncodedValueTest.java
+++ b/core/src/test/java/com/graphhopper/routing/profiles/DecimalEncodedValueTest.java
@@ -29,7 +29,7 @@ public class DecimalEncodedValueTest {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "motorway_link");
         way.setTag("maxspeed", "70 mph");
-        IntsRef flags = carEncoder.handleWayTags(em.createEdgeFlags(), way, carEncoder.acceptWay(way), 0);
+        IntsRef flags = carEncoder.handleWayTags(em.createEdgeFlags(), way, carEncoder.getAccess(way), 0);
         assertEquals(101.5, carAverageSpeedEnc.getDecimal(true, flags), 1e-1);
 
         DecimalEncodedValue instance1 = new FactorizedDecimalEncodedValue("test1", 8, 0.5, false);
diff --git a/core/src/test/java/com/graphhopper/routing/util/AbstractBikeFlagEncoderTester.java b/core/src/test/java/com/graphhopper/routing/util/AbstractBikeFlagEncoderTester.java
index 7693e729a..77525f213 100644
--- a/core/src/test/java/com/graphhopper/routing/util/AbstractBikeFlagEncoderTester.java
+++ b/core/src/test/java/com/graphhopper/routing/util/AbstractBikeFlagEncoderTester.java
@@ -65,8 +65,7 @@ public abstract class AbstractBikeFlagEncoderTester {
     }
 
     protected double getSpeedFromFlags(ReaderWay way) {
-        long allowed = encoder.acceptBit;
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, allowed, 0);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, EncodingManager.Access.WAY, 0);
         return avSpeedEnc.getDecimal(false, flags);
     }
 
@@ -75,8 +74,7 @@ public abstract class AbstractBikeFlagEncoderTester {
     }
 
     protected String getWayTypeFromFlags(ReaderWay way, long relationFlags) {
-        long allowed = encoder.acceptBit;
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, allowed, relationFlags);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, EncodingManager.Access.WAY, relationFlags);
         Translation enMap = SINGLETON.getWithFallBack(Locale.UK);
         return encoder.getAnnotation(flags, enMap).getMessage();
     }
@@ -86,122 +84,122 @@ public abstract class AbstractBikeFlagEncoderTester {
         ReaderWay way = new ReaderWay(1);
 
         way.setTag("highway", "motorway");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.setTag("highway", "motorway");
         way.setTag("bicycle", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("highway", "footway");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("bicycle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.setTag("highway", "footway");
         way.setTag("bicycle", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("highway", "pedestrian");
         way.setTag("bicycle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.setTag("highway", "pedestrian");
         way.setTag("bicycle", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("bicycle", "yes");
         way.setTag("highway", "cycleway");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "path");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("highway", "path");
         way.setTag("bicycle", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
         way.clearTags();
 
         way.setTag("highway", "track");
         way.setTag("bicycle", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
         way.clearTags();
 
         way.setTag("highway", "track");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("mtb", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "path");
         way.setTag("foot", "official");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("bicycle", "official");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "tertiary");
         way.setTag("motorroad", "yes");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "track");
         way.setTag("ford", "yes");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("bicycle", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "secondary");
         way.setTag("access", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("bicycle", "dismount");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "secondary");
         way.setTag("vehicle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("bicycle", "dismount");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("route", "ferry");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isFerry());
         way.setTag("bicycle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("route", "ferry");
         way.setTag("foot", "yes");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "cycleway");
         way.setTag("cycleway", "track");
         way.setTag("railway", "abandoned");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         DateFormat simpleDateFormat = Helper.createFormatter("yyyy MMM dd");
 
         way.clearTags();
         way.setTag("highway", "road");
         way.setTag("bicycle:conditional", "no @ (" + simpleDateFormat.format(new Date().getTime()) + ")");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "road");
         way.setTag("access", "no");
         way.setTag("bicycle:conditional", "yes @ (" + simpleDateFormat.format(new Date().getTime()) + ")");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
     }
 
     @Test
@@ -209,38 +207,39 @@ public abstract class AbstractBikeFlagEncoderTester {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "secondary");
         way.setTag("railway", "rail");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way = new ReaderWay(1);
         way.setTag("highway", "secondary");
         way.setTag("railway", "station");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way = new ReaderWay(1);
         way.setTag("highway", "secondary");
         way.setTag("railway", "station");
         way.setTag("bicycle", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("bicycle", "no");
-        assertTrue(encoder.acceptWay(way) == 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way = new ReaderWay(1);
         way.setTag("railway", "platform");
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertNotEquals(0, flags.ints[0]);
 
         way = new ReaderWay(1);
         way.setTag("highway", "track");
         way.setTag("railway", "platform");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertNotEquals(0, flags.ints[0]);
 
         way = new ReaderWay(1);
         way.setTag("highway", "track");
         way.setTag("railway", "platform");
         way.setTag("bicycle", "no");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertEquals(0, flags.ints[0]);
     }
 
@@ -384,10 +383,10 @@ public abstract class AbstractBikeFlagEncoderTester {
         way.setTag("highway", "service");
         way.setTag("sac_scale", "hiking");
         // allow
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("sac_scale", "alpine_hiking");
-        assertTrue(encoder.acceptWay(way) == 0);
+        assertTrue(encoder.getAccess(way).canSkip());
     }
 
     @Test
@@ -411,7 +410,7 @@ public abstract class AbstractBikeFlagEncoderTester {
     public void testHandleWayTagsCallsHandlePriority() {
         ReaderWay osmWay = new ReaderWay(1);
         osmWay.setTag("highway", "cycleway");
-        IntsRef edgeFlags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, encoder.acceptBit, 0);
+        IntsRef edgeFlags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         DecimalEncodedValue priorityEnc = encodingManager.getDecimalEncodedValue(EncodingManager.getKey(encoder, "priority"));
         assertEquals((double) VERY_NICE.getValue() / BEST.getValue(), priorityEnc.getDecimal(false, edgeFlags), 1e-3);
     }
diff --git a/core/src/test/java/com/graphhopper/routing/util/Bike2WeightFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/Bike2WeightFlagEncoderTest.java
index b09019940..f59be0c45 100644
--- a/core/src/test/java/com/graphhopper/routing/util/Bike2WeightFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/Bike2WeightFlagEncoderTest.java
@@ -96,9 +96,10 @@ public class Bike2WeightFlagEncoderTest extends BikeFlagEncoderTest {
         ReaderWay way = new ReaderWay(0);
         way.setTag("route", "ferry");
 
-        long includeWay = encodingManager.acceptWay(way);
+        EncodingManager.AcceptWay map = new EncodingManager.AcceptWay();
+        assertTrue(encodingManager.acceptWay(way, map));
         long relationFlags = 0;
-        IntsRef wayFlags = encodingManager.handleWayTags(way, includeWay, relationFlags);
+        IntsRef wayFlags = encodingManager.handleWayTags(way, map, relationFlags);
         graph.edge(0, 1).setDistance(247).setFlags(wayFlags);
 
         assertTrue(isGraphValid(graph, encoder));
diff --git a/core/src/test/java/com/graphhopper/routing/util/BikeFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/BikeFlagEncoderTest.java
index 3afcb361f..82594df9b 100644
--- a/core/src/test/java/com/graphhopper/routing/util/BikeFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/BikeFlagEncoderTest.java
@@ -296,84 +296,84 @@ public class BikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "cycleway");
         way.setTag("vehicle", "no");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         // Sensless tagging: JOSM does create a warning here. We follow the highway tag:
         way.setTag("bicycle", "no");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("bicycle", "designated");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "motorway");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("bicycle", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "residential");
         way.setTag("bicycle", "yes");
         way.setTag("access", "no");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         // #1122
         way.clearTags();
         way.setTag("route", "ferry");
         way.setTag("bicycle", "yes");
         way.setTag("access", "private");
-        assertTrue(encoder.acceptWay(way) == 0);
+        assertTrue(encoder.getAccess(way).canSkip());
     }
 
     @Test
     public void testOneway() {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "tertiary");
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(encoder.getAccessEnc().getBool(false, flags));
         assertTrue(encoder.getAccessEnc().getBool(true, flags));
         way.setTag("oneway", "yes");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(encoder.getAccessEnc().getBool(false, flags));
         assertFalse(encoder.getAccessEnc().getBool(true, flags));
         way.clearTags();
         way.setTag("highway", "tertiary");
         way.setTag("oneway:bicycle", "yes");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(encoder.getAccessEnc().getBool(false, flags));
         assertFalse(encoder.getAccessEnc().getBool(true, flags));
         way.clearTags();
 
         way.setTag("highway", "tertiary");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(encoder.getAccessEnc().getBool(false, flags));
         assertTrue(encoder.getAccessEnc().getBool(true, flags));
         way.clearTags();
 
         way.setTag("highway", "tertiary");
         way.setTag("vehicle:forward", "no");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertFalse(encoder.getAccessEnc().getBool(false, flags));
         assertTrue(encoder.getAccessEnc().getBool(true, flags));
         way.clearTags();
 
         way.setTag("highway", "tertiary");
         way.setTag("bicycle:forward", "no");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertFalse(encoder.getAccessEnc().getBool(false, flags));
         assertTrue(encoder.getAccessEnc().getBool(true, flags));
         way.clearTags();
 
         way.setTag("highway", "tertiary");
         way.setTag("vehicle:backward", "no");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(encoder.getAccessEnc().getBool(false, flags));
         assertFalse(encoder.getAccessEnc().getBool(true, flags));
         way.clearTags();
 
         way.setTag("highway", "tertiary");
         way.setTag("motor_vehicle:backward", "no");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(encoder.getAccessEnc().getBool(false, flags));
         assertTrue(encoder.getAccessEnc().getBool(true, flags));
         way.clearTags();
@@ -383,12 +383,12 @@ public class BikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         way.setTag("highway", "tertiary");
         way.setTag("oneway", "yes");
         way.setTag("bicycle:backward", "no");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(encoder.getAccessEnc().getBool(false, flags));
         assertTrue(encoder.getAccessEnc().getBool(true, flags));
 
         way.setTag("bicycle:backward", "yes");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(encoder.getAccessEnc().getBool(false, flags));
         assertTrue(encoder.getAccessEnc().getBool(true, flags));
 
@@ -396,7 +396,7 @@ public class BikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         way.setTag("highway", "tertiary");
         way.setTag("oneway", "yes");
         way.setTag("cycleway", "opposite");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(encoder.getAccessEnc().getBool(false, flags));
         assertTrue(encoder.getAccessEnc().getBool(true, flags));
 
@@ -404,7 +404,7 @@ public class BikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         way.setTag("highway", "residential");
         way.setTag("oneway", "yes");
         way.setTag("cycleway:left", "opposite_lane");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(encoder.getAccessEnc().getBool(false, flags));
         assertTrue(encoder.getAccessEnc().getBool(true, flags));
     }
@@ -413,24 +413,23 @@ public class BikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
     public void testHandleWayTagsInfluencedByRelation() {
         ReaderWay osmWay = new ReaderWay(1);
         osmWay.setTag("highway", "road");
-        long allowed = encoder.acceptBit;
 
         ReaderRelation osmRel = new ReaderRelation(1);
         long relFlags = encoder.handleRelationTags(0, osmRel);
         // unchanged
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(12, encoder.getSpeed(flags), 1e-1);
         assertPriority(UNCHANGED.getValue(), osmWay, relFlags);
 
         // relation code is PREFER
         osmRel.setTag("route", "bicycle");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(12, encoder.getSpeed(flags), 1e-1);
         assertPriority(PREFER.getValue(), osmWay, relFlags);
         osmRel.setTag("network", "lcn");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(12, encoder.getSpeed(flags), 1e-1);
         assertPriority(PREFER.getValue(), osmWay, relFlags);
 
@@ -496,40 +495,36 @@ public class BikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "path");
         way.setTag("sac_scale", "hiking");
-        // allow
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("highway", "path");
         way.setTag("sac_scale", "mountain_hiking");
-        // disallow
-        assertEquals(0, encoder.acceptWay(way));
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.setTag("highway", "cycleway");
         way.setTag("sac_scale", "hiking");
-        // allow
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("highway", "cycleway");
         way.setTag("sac_scale", "mountain_hiking");
         // disallow questionable combination as too dangerous
-        assertEquals(0, encoder.acceptWay(way));
+        assertTrue(encoder.getAccess(way).canSkip());
     }
 
     @Test
     public void testCalcPriority() {
-        long allowed = encoder.acceptBit;
         ReaderWay osmWay = new ReaderWay(1);
         ReaderRelation osmRel = new ReaderRelation(1);
         osmRel.setTag("route", "bicycle");
         osmRel.setTag("network", "icn");
         long relFlags = encoder.handleRelationTags(0, osmRel);
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(PriorityCode.getFactor(BEST.getValue()), priorityEnc.getDecimal(false, flags), .1);
 
         // important: UNCHANGED should not get 0 priority!
         osmWay = new ReaderWay(1);
         osmWay.setTag("highway", "somethingelse");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         assertEquals(PriorityCode.getFactor(UNCHANGED.getValue()), priorityEnc.getDecimal(false, flags), .1);
     }
 
@@ -538,7 +533,7 @@ public class BikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "secondary");
         way.setTag("maxspeed", "10");
-        long allowed = encoder.acceptWay(way);
+        EncodingManager.Access allowed = encoder.getAccess(way);
         IntsRef edgeFlags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, allowed, 0);
         assertEquals(10, encoder.getSpeed(edgeFlags), 1e-1);
         assertPriority(VERY_NICE.getValue(), way);
@@ -565,7 +560,7 @@ public class BikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         edgeFlags = encodingManager.createEdgeFlags();
         encoder.setSpeed(false, edgeFlags, encoder.applyMaxSpeed(way, 15));
         assertEquals(15, encoder.getSpeed(edgeFlags), 1.0);
-        allowed = encoder.acceptWay(way);
+        allowed = encoder.getAccess(way);
         edgeFlags = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, allowed, 0);
         assertEquals(15, encoder.getSpeed(edgeFlags), 1.0);
         assertPriority(VERY_NICE.getValue(), way);
diff --git a/core/src/test/java/com/graphhopper/routing/util/Car4WDFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/Car4WDFlagEncoderTest.java
index 207f6282a..9c24487bc 100644
--- a/core/src/test/java/com/graphhopper/routing/util/Car4WDFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/Car4WDFlagEncoderTest.java
@@ -39,91 +39,89 @@ public class Car4WDFlagEncoderTest extends CarFlagEncoderTest {
     @Test
     public void testAccess() {
         ReaderWay way = new ReaderWay(1);
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("highway", "service");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
         way.setTag("access", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "track");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("motorcar", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         // for now allow grade1+2+3 for every country, see #253
         way.clearTags();
         way.setTag("highway", "track");
         way.setTag("tracktype", "grade2");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
         // This is the only difference from a "car"
         way.setTag("tracktype", "grade4");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "delivery");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "unclassified");
         way.setTag("ford", "yes");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("motorcar", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("route", "ferry");
-        assertTrue(encoder.acceptWay(way) > 0);
-        assertTrue(encoder.isFerry(encoder.acceptWay(way)));
+        assertTrue(encoder.getAccess(way).isFerry());
         way.setTag("motorcar", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("route", "ferry");
         way.setTag("foot", "yes");
-        assertFalse(encoder.acceptWay(way) > 0);
-        assertFalse(encoder.isFerry(encoder.acceptWay(way)));
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("access", "yes");
         way.setTag("motor_vehicle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "yes");
         way.setTag("motor_vehicle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "no");
         way.setTag("motorcar", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "emergency");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("motor_vehicle", "emergency");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         DateFormat simpleDateFormat = Helper.createFormatter("yyyy MMM dd");
 
         way.clearTags();
         way.setTag("highway", "road");
         way.setTag("access:conditional", "no @ (" + simpleDateFormat.format(new Date().getTime()) + ")");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "road");
         way.setTag("access", "no");
         way.setTag("access:conditional", "yes @ (" + simpleDateFormat.format(new Date().getTime()) + ")");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
     }
 }
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 ace59bc44..9ae14c7d8 100644
--- a/core/src/test/java/com/graphhopper/routing/util/CarFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/CarFlagEncoderTest.java
@@ -46,98 +46,96 @@ public class CarFlagEncoderTest {
     @Test
     public void testAccess() {
         ReaderWay way = new ReaderWay(1);
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("highway", "service");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
         way.setTag("access", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "track");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("motorcar", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         // for now allow grade1+2+3 for every country, see #253
         way.clearTags();
         way.setTag("highway", "track");
         way.setTag("tracktype", "grade2");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
         way.setTag("tracktype", "grade4");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "delivery");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "unclassified");
         way.setTag("ford", "yes");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("motorcar", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("route", "ferry");
-        assertTrue(encoder.acceptWay(way) > 0);
-        assertTrue(encoder.isFerry(encoder.acceptWay(way)));
+        assertTrue(encoder.getAccess(way).isFerry());
         way.setTag("motorcar", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("route", "ferry");
         way.setTag("foot", "yes");
-        assertFalse(encoder.acceptWay(way) > 0);
-        assertFalse(encoder.isFerry(encoder.acceptWay(way)));
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("route", "ferry");
         way.setTag("access", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("vehicle", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isFerry());
 
         way.clearTags();
         way.setTag("access", "yes");
         way.setTag("motor_vehicle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "yes");
         way.setTag("motor_vehicle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "no");
         way.setTag("motorcar", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "emergency");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("motor_vehicle", "emergency");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         DateFormat simpleDateFormat = Helper.createFormatter("yyyy MMM dd");
 
         way.clearTags();
         way.setTag("highway", "road");
         way.setTag("access:conditional", "no @ (" + simpleDateFormat.format(new Date().getTime()) + ")");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "road");
         way.setTag("access", "no");
         way.setTag("access:conditional", "yes @ (" + simpleDateFormat.format(new Date().getTime()) + ")");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
     }
 
     @Test
@@ -145,7 +143,7 @@ public class CarFlagEncoderTest {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "track");
         way.setTag("access", "military");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
     }
 
     @Test
@@ -159,13 +157,13 @@ public class CarFlagEncoderTest {
 
         // Node and way are initially blocking
         assertTrue(encoder.isBlockFords());
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         assertTrue(encoder.handleNodeTags(node) > 0);
 
         try {
             // Now they are passable
             encoder.setBlockFords(false);
-            assertTrue(encoder.acceptWay(way) > 0);
+            assertTrue(encoder.getAccess(way).isWay());
             assertFalse(encoder.handleNodeTags(node) > 0);
         } finally {
             encoder.setBlockFords(true);
@@ -176,31 +174,31 @@ public class CarFlagEncoderTest {
     public void testOneway() {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "primary");
-        IntsRef flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        IntsRef flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(accessEnc.getBool(false, flags));
         assertTrue(accessEnc.getBool(true, flags));
         way.setTag("oneway", "yes");
-        flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(accessEnc.getBool(false, flags));
         assertFalse(accessEnc.getBool(true, flags));
         way.clearTags();
 
         way.setTag("highway", "tertiary");
-        flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(accessEnc.getBool(false, flags));
         assertTrue(accessEnc.getBool(true, flags));
         way.clearTags();
 
         way.setTag("highway", "tertiary");
         way.setTag("vehicle:forward", "no");
-        flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertFalse(accessEnc.getBool(false, flags));
         assertTrue(accessEnc.getBool(true, flags));
         way.clearTags();
 
         way.setTag("highway", "tertiary");
         way.setTag("vehicle:backward", "no");
-        flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertTrue(accessEnc.getBool(false, flags));
         assertFalse(accessEnc.getBool(true, flags));
         way.clearTags();
@@ -214,7 +212,7 @@ public class CarFlagEncoderTest {
         assertEquals(60, encoder.getSpeed(way), 1e-1);
 
         way.setTag("vehicle", "destination");
-        IntsRef flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        IntsRef flags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertEquals(5, avSpeedEnc.getDecimal(false, flags), 1e-1);
     }
 
@@ -259,7 +257,7 @@ public class CarFlagEncoderTest {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "trunk");
         way.setTag("maxspeed", "500");
-        long allowed = encoder.acceptWay(way);
+        EncodingManager.Access allowed = encoder.getAccess(way);
         IntsRef edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, allowed, 0);
         assertEquals(140, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
@@ -267,25 +265,25 @@ public class CarFlagEncoderTest {
         way.setTag("highway", "primary");
         way.setTag("maxspeed:backward", "10");
         way.setTag("maxspeed:forward", "20");
-        edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertEquals(10, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
         way = new ReaderWay(1);
         way.setTag("highway", "primary");
         way.setTag("maxspeed:forward", "20");
-        edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertEquals(20, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
         way = new ReaderWay(1);
         way.setTag("highway", "primary");
         way.setTag("maxspeed:backward", "20");
-        edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertEquals(20, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
         way = new ReaderWay(1);
         way.setTag("highway", "motorway");
         way.setTag("maxspeed", "none");
-        edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptWay(way), 0);
+        edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.getAccess(way), 0);
         assertEquals(125, avSpeedEnc.getDecimal(false, edgeFlags), .1);
     }
 
@@ -295,55 +293,55 @@ public class CarFlagEncoderTest {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "trunk");
         way.setTag("maxspeed", "110");
-        long allowed = encoder.acceptWay(way);
+        EncodingManager.Access allowed = encoder.getAccess(way);
         IntsRef edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, allowed, 0);
         assertEquals(100, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
         way.clearTags();
         way.setTag("highway", "residential");
         way.setTag("surface", "cobblestone");
-        allowed = encoder.acceptWay(way);
+        allowed = encoder.getAccess(way);
         edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, allowed, 0);
         assertEquals(30, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
         way.clearTags();
         way.setTag("highway", "track");
-        allowed = encoder.acceptWay(way);
+        allowed = encoder.getAccess(way);
         edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, allowed, 0);
         assertEquals(15, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
         way.clearTags();
         way.setTag("highway", "track");
         way.setTag("tracktype", "grade1");
-        allowed = encoder.acceptWay(way);
+        allowed = encoder.getAccess(way);
         edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, allowed, 0);
         assertEquals(20, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
         way.clearTags();
         way.setTag("highway", "secondary");
         way.setTag("surface", "compacted");
-        allowed = encoder.acceptWay(way);
+        allowed = encoder.getAccess(way);
         edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, allowed, 0);
         assertEquals(30, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
         way.clearTags();
         way.setTag("highway", "secondary");
         way.setTag("motorroad", "yes");
-        allowed = encoder.acceptWay(way);
+        allowed = encoder.getAccess(way);
         edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, allowed, 0);
         assertEquals(90, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
         way.clearTags();
         way.setTag("highway", "motorway");
         way.setTag("motorroad", "yes"); // this tag should be ignored
-        allowed = encoder.acceptWay(way);
+        allowed = encoder.getAccess(way);
         edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, allowed, 0);
         assertEquals(100, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
         way.clearTags();
         way.setTag("highway", "motorway_link");
         way.setTag("motorroad", "yes"); // this tag should be ignored
-        allowed = encoder.acceptWay(way);
+        allowed = encoder.getAccess(way);
         edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, allowed, 0);
         assertEquals(70, avSpeedEnc.getDecimal(false, edgeFlags), 1e-1);
 
@@ -397,7 +395,7 @@ public class CarFlagEncoderTest {
 
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "motorway");
-        edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, encoder.acceptBit, 0);
+        edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, EncodingManager.Access.WAY, 0);
         assertTrue(accessEnc.getBool(false, edgeFlags));
         assertTrue(accessEnc.getBool(true, edgeFlags));
         assertFalse(roundaboutEnc.getBool(false, edgeFlags));
@@ -408,29 +406,29 @@ public class CarFlagEncoderTest {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "secondary");
         way.setTag("railway", "rail");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "path");
         way.setTag("railway", "abandoned");
-        assertTrue(encoder.acceptWay(way) == 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.setTag("highway", "track");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         // this is fully okay as sometimes old rails are on the road
         way.setTag("highway", "primary");
         way.setTag("railway", "historic");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("motorcar", "no");
-        assertTrue(encoder.acceptWay(way) == 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way = new ReaderWay(1);
         way.setTag("highway", "secondary");
         way.setTag("railway", "tram");
         // but allow tram to be on the same way
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way = new ReaderWay(1);
         way.setTag("route", "shuttle_train");
@@ -440,7 +438,7 @@ public class CarFlagEncoderTest {
         way.setTag("duration:seconds", Long.toString(35 * 60));
         way.setTag("estimated_distance", 50000);
         // accept
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isFerry());
         // calculate speed from estimated_distance and duration
         assertEquals(61, encoder.getFerrySpeed(way), 1e-1);
 
@@ -452,7 +450,7 @@ public class CarFlagEncoderTest {
         way.setTag("duration:seconds", Long.toString(12 * 60));
         way.setTag("estimated_distance", 100);
         // accept
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isFerry());
         // We can't store 0.5km/h, but we expect the lowest possible speed (5km/h)
         assertEquals(2.5, encoder.getFerrySpeed(way), 1e-1);
 
@@ -468,7 +466,7 @@ public class CarFlagEncoderTest {
         way.setTag("duration:seconds", Long.toString(87900 * 60));
         way.setTag("estimated_distance", 100);
         // accept
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isFerry());
         // We have ignored the unrealisitc long duration and take the unknown speed
         assertEquals(2.5, encoder.getFerrySpeed(way), 1e-1);
     }
@@ -580,7 +578,7 @@ public class CarFlagEncoderTest {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "motorway_link");
         way.setTag("maxspeed", "60 mph");
-        IntsRef edgeFlags = instance.handleWayTags(em.createEdgeFlags(), way, 1, 0);
+        IntsRef edgeFlags = instance.handleWayTags(em.createEdgeFlags(), way, EncodingManager.Access.WAY, 0);
 
         // double speed = AbstractFlagEncoder.parseSpeed("60 mph");
         // => 96.56 * 0.9 => 86.9
@@ -591,7 +589,7 @@ public class CarFlagEncoderTest {
         way = new ReaderWay(2);
         way.setTag("highway", "motorway_link");
         way.setTag("maxspeed", "70 mph");
-        edgeFlags = instance.handleWayTags(em.createEdgeFlags(), way, 1, 0);
+        edgeFlags = instance.handleWayTags(em.createEdgeFlags(), way, EncodingManager.Access.WAY, 0);
         assertEquals(101.5, avSpeedEnc.getDecimal(false, edgeFlags), .1);
     }
 
@@ -619,10 +617,12 @@ public class CarFlagEncoderTest {
         way.setTag("highway", "cycleway");
         way.setTag("sac_scale", "hiking");
 
-        BooleanEncodedValue bikeAccessEnc = em.getEncoder("bike").getAccessEnc();
-        IntsRef edgeFlags = em.handleWayTags(way, em.acceptWay(way), 0);
+        EncodingManager.AcceptWay map = new EncodingManager.AcceptWay();
+        assertTrue(em.acceptWay(way, map));
+        IntsRef edgeFlags = em.handleWayTags(way, map, 0);
         assertFalse(accessEnc.getBool(true, edgeFlags));
         assertFalse(accessEnc.getBool(false, edgeFlags));
+        BooleanEncodedValue bikeAccessEnc = em.getEncoder("bike").getAccessEnc();
         assertTrue(bikeAccessEnc.getBool(true, edgeFlags));
         assertTrue(bikeAccessEnc.getBool(false, edgeFlags));
     }
diff --git a/core/src/test/java/com/graphhopper/routing/util/DataFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/DataFlagEncoderTest.java
index 9ea657d1d..4817d8830 100644
--- a/core/src/test/java/com/graphhopper/routing/util/DataFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/DataFlagEncoderTest.java
@@ -3,7 +3,6 @@ package com.graphhopper.routing.util;
 import com.graphhopper.reader.ReaderWay;
 import com.graphhopper.routing.AbstractRoutingAlgorithmTester;
 import com.graphhopper.routing.profiles.BooleanEncodedValue;
-import com.graphhopper.routing.util.spatialrules.AccessValue;
 import com.graphhopper.routing.util.spatialrules.SpatialRule;
 import com.graphhopper.routing.util.spatialrules.SpatialRuleLookup;
 import com.graphhopper.routing.util.spatialrules.countries.GermanySpatialRule;
@@ -67,7 +66,7 @@ public class DataFlagEncoderTest {
         osmWay.setTag("highway", "primary");
         osmWay.setTag("surface", "sand");
         osmWay.setTag("tunnel", "yes");
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         EdgeIteratorState edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals("primary", encoder.getHighwayAsString(edge));
         assertEquals("sand", encoder.getSurfaceAsString(edge));
@@ -78,14 +77,14 @@ public class DataFlagEncoderTest {
         osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "primary");
         osmWay.setTag("oneway", "yes");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertTrue(edge.get(accessEnc));
         assertFalse(edge.getReverse(accessEnc));
 
         osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "unknownX");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals("_default", encoder.getHighwayAsString(edge));
     }
@@ -95,7 +94,7 @@ public class DataFlagEncoderTest {
         ReaderWay osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "primary");
         osmWay.setTag("tunnel", "yes");
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         EdgeIteratorState edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals("primary", encoder.getHighwayAsString(edge));
         assertEquals("tunnel", encoder.getTransportModeAsString(edge));
@@ -106,7 +105,7 @@ public class DataFlagEncoderTest {
         osmWay.setTag("highway", "primary");
         osmWay.setTag("tunnel", "yes");
         osmWay.setTag("bridge", "yes");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals("bridge", encoder.getTransportModeAsString(edge));
         assertFalse(encoder.isTransportModeTunnel(edge));
@@ -118,7 +117,7 @@ public class DataFlagEncoderTest {
         ReaderWay osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "primary");
         osmWay.setTag("bridge", "yes");
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         EdgeIteratorState edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals("primary", encoder.getHighwayAsString(edge));
         assertEquals("bridge", encoder.getTransportModeAsString(edge));
@@ -129,7 +128,7 @@ public class DataFlagEncoderTest {
         osmWay.setTag("highway", "primary");
         osmWay.setTag("bridge", "yes");
         osmWay.setTag("tunnel", "yes");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals("bridge", encoder.getTransportModeAsString(edge));
         assertFalse(encoder.isTransportModeTunnel(edge));
@@ -141,7 +140,7 @@ public class DataFlagEncoderTest {
         ReaderWay osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "unclassified");
         osmWay.setTag("ford", "yes");
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         EdgeIteratorState edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals("ford", encoder.getTransportModeAsString(edge));
         assertTrue(encoder.isTransportModeFord(edge.getFlags()));
@@ -165,16 +164,16 @@ public class DataFlagEncoderTest {
     public void testDestinationTag() {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "secondary");
-        IntsRef intsref = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
-        assertEquals(AccessValue.ACCESSIBLE, encoder.getAccessValue(intsref));
+        IntsRef intsref = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
+        assertEquals(SpatialRule.Access.YES, encoder.getAccessValue(intsref));
 
         way.setTag("vehicle", "destination");
-        intsref = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
-        assertEquals(AccessValue.EVENTUALLY_ACCESSIBLE, encoder.getAccessValue(intsref));
+        intsref = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
+        assertEquals(SpatialRule.Access.CONDITIONAL, encoder.getAccessValue(intsref));
 
         way.setTag("vehicle", "no");
-        intsref = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.acceptWay(way), 0);
-        assertEquals(AccessValue.NOT_ACCESSIBLE, encoder.getAccessValue(intsref));
+        intsref = encoder.handleWayTags(encodingManager.createEdgeFlags(), way, encoder.getAccess(way), 0);
+        assertEquals(SpatialRule.Access.NO, encoder.getAccessValue(intsref));
     }
 
     @Test
@@ -182,7 +181,7 @@ public class DataFlagEncoderTest {
         ReaderWay osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "primary");
         osmWay.setTag("maxspeed", "10");
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         EdgeIteratorState edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals(10, encoder.getMaxspeed(edge, motorVehicleInt, false), .1);
         assertEquals(10, encoder.getMaxspeed(edge, motorVehicleInt, true), .1);
@@ -190,7 +189,7 @@ public class DataFlagEncoderTest {
         osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "primary");
         osmWay.setTag("maxspeed:forward", "10");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals(10, encoder.getMaxspeed(edge, motorVehicleInt, false), .1);
         assertEquals(-1, encoder.getMaxspeed(edge, motorVehicleInt, true), .1);
@@ -200,7 +199,7 @@ public class DataFlagEncoderTest {
         osmWay.setTag("maxspeed:forward", "50");
         osmWay.setTag("maxspeed:backward", "50");
         osmWay.setTag("maxspeed", "60");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals(50, encoder.getMaxspeed(edge, motorVehicleInt, false), .1);
         assertEquals(50, encoder.getMaxspeed(edge, motorVehicleInt, true), .1);
@@ -211,7 +210,7 @@ public class DataFlagEncoderTest {
         ReaderWay osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "primary");
         osmWay.setTag("maxspeed", "145");
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         EdgeIteratorState edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals(140, encoder.getMaxspeed(edge, motorVehicleInt, false), .1);
         assertEquals(140, encoder.getMaxspeed(edge, motorVehicleInt, true), .1);
@@ -219,7 +218,7 @@ public class DataFlagEncoderTest {
         osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "primary");
         osmWay.setTag("maxspeed", "1000");
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         edge = GHUtility.createMockedEdgeIteratorState(0, flags);
         assertEquals(140, encoder.getMaxspeed(edge, motorVehicleInt, false), .1);
         assertEquals(140, encoder.getMaxspeed(edge, motorVehicleInt, true), .1);
@@ -232,7 +231,7 @@ public class DataFlagEncoderTest {
         ReaderWay osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "primary");
         osmWay.setTag("maxspeed:forward", "10");
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, 1, 0);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, 0);
         edge.setFlags(flags);
 
         assertEquals(10, encoder.getMaxspeed(edge, motorVehicleInt, false), .1);
@@ -275,11 +274,11 @@ public class DataFlagEncoderTest {
     public void acceptWay() {
         ReaderWay osmWay = new ReaderWay(0);
         osmWay.setTag("highway", "primary");
-        assertTrue(encoder.acceptWay(osmWay) != 0);
+        assertTrue(encoder.getAccess(osmWay).isWay());
 
         // important to filter out illegal highways to reduce the number of edges before adding them to the graph
         osmWay.setTag("highway", "building");
-        assertTrue(encoder.acceptWay(osmWay) == 0);
+        assertTrue(encoder.getAccess(osmWay).canSkip());
     }
 
     @Test
@@ -407,16 +406,16 @@ public class DataFlagEncoderTest {
         AbstractRoutingAlgorithmTester.updateDistancesFor(graph, 3, 0.01, 0.01);
         AbstractRoutingAlgorithmTester.updateDistancesFor(graph, 4, -0.01, -0.01);
 
-        e1.setFlags(encoder.handleWayTags(em.createEdgeFlags(), way, 1, 0));
-        e2.setFlags(encoder.handleWayTags(em.createEdgeFlags(), way2, 1, 0));
-        e3.setFlags(encoder.handleWayTags(em.createEdgeFlags(), livingStreet, 1, 0));
-        e4.setFlags(encoder.handleWayTags(em.createEdgeFlags(), livingStreet2, 1, 0));
+        e1.setFlags(encoder.handleWayTags(em.createEdgeFlags(), way, EncodingManager.Access.WAY, 0));
+        e2.setFlags(encoder.handleWayTags(em.createEdgeFlags(), way2, EncodingManager.Access.WAY, 0));
+        e3.setFlags(encoder.handleWayTags(em.createEdgeFlags(), livingStreet, EncodingManager.Access.WAY, 0));
+        e4.setFlags(encoder.handleWayTags(em.createEdgeFlags(), livingStreet2, EncodingManager.Access.WAY, 0));
 
         assertEquals(index.getSpatialId(new GermanySpatialRule()), encoder.getSpatialId(e1.getFlags()));
         assertEquals(index.getSpatialId(SpatialRule.EMPTY), encoder.getSpatialId(e2.getFlags()));
 
-        assertEquals(AccessValue.EVENTUALLY_ACCESSIBLE, encoder.getAccessValue(e1.getFlags()));
-        assertEquals(AccessValue.ACCESSIBLE, encoder.getAccessValue(e2.getFlags()));
+        assertEquals(SpatialRule.Access.CONDITIONAL, encoder.getAccessValue(e1.getFlags()));
+        assertEquals(SpatialRule.Access.YES, encoder.getAccessValue(e2.getFlags()));
 
         assertEquals(5, encoder.getMaxspeed(e3, -1, false), .1);
         assertEquals(-1, encoder.getMaxspeed(e4, -1, false), .1);
diff --git a/core/src/test/java/com/graphhopper/routing/util/EncodingManagerTest.java b/core/src/test/java/com/graphhopper/routing/util/EncodingManagerTest.java
index b0c8ac444..8fbbf9ddb 100644
--- a/core/src/test/java/com/graphhopper/routing/util/EncodingManagerTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/EncodingManagerTest.java
@@ -118,12 +118,12 @@ public class EncodingManagerTest {
             }
 
             @Override
-            public long acceptWay(ReaderWay way) {
-                return 0;
+            public EncodingManager.Access getAccess(ReaderWay way) {
+                return EncodingManager.Access.WAY;
             }
 
             @Override
-            public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, long allowed, long relationFlags) {
+            public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access accept, long relationFlags) {
                 return edgeFlags;
             }
         };
@@ -170,8 +170,9 @@ public class EncodingManagerTest {
         osmRel.setTag("route", "bicycle");
         osmRel.setTag("network", "lcn");
         long relFlags = manager.handleRelationTags(0, osmRel);
-        long allow = defaultBike.acceptBit | lessRelationCodes.acceptBit;
-        IntsRef edgeFlags = manager.handleWayTags(osmWay, allow, relFlags);
+        EncodingManager.AcceptWay map = new EncodingManager.AcceptWay();
+        manager.acceptWay(osmWay, map);
+        IntsRef edgeFlags = manager.handleWayTags(osmWay, map, relFlags);
 
         assertTrue(defaultBike.relationCodeEncoder.getValue(edgeFlags.ints[0])
                 > lessRelationCodes.relationCodeEncoder.getValue(edgeFlags.ints[0]));
@@ -193,8 +194,9 @@ public class EncodingManagerTest {
         osmRel.setTag("route", "bicycle");
         osmRel.setTag("network", "rcn");
         long relFlags = manager.handleRelationTags(0, osmRel);
-        long allow = bikeEncoder.acceptBit | mtbEncoder.acceptBit;
-        IntsRef flags = manager.handleWayTags(osmWay, allow, relFlags);
+        EncodingManager.AcceptWay map = new EncodingManager.AcceptWay();
+        manager.acceptWay(osmWay, map);
+        IntsRef flags = manager.handleWayTags(osmWay, map, relFlags);
 
         // bike: uninfluenced speed for grade but via network => VERY_NICE                
         // mtb: uninfluenced speed only PREFER
@@ -226,7 +228,9 @@ public class EncodingManagerTest {
         osmWay.setTag("name", "test");
 
         BikeFlagEncoder singleBikeEnc = (BikeFlagEncoder) manager2.getEncoder("bike2");
-        IntsRef flags = manager2.handleWayTags(osmWay, singleBikeEnc.acceptBit, 0);
+        EncodingManager.AcceptWay map = new EncodingManager.AcceptWay();
+        manager2.acceptWay(osmWay, map);
+        IntsRef flags = manager2.handleWayTags(osmWay, map, 0);
         double singleSpeed = singleBikeEnc.getSpeed(flags);
         assertEquals(4, singleSpeed, 1e-3);
         assertEquals(singleSpeed, singleBikeEnc.getSpeed(true, flags), 1e-3);
@@ -235,8 +239,9 @@ public class EncodingManagerTest {
         FootFlagEncoder foot = (FootFlagEncoder) manager.getEncoder("foot");
         BikeFlagEncoder bike = (BikeFlagEncoder) manager.getEncoder("bike2");
 
-        long acceptBits = foot.acceptBit | bike.acceptBit;
-        flags = manager.handleWayTags(osmWay, acceptBits, 0);
+        map = new EncodingManager.AcceptWay();
+        manager.acceptWay(osmWay, map);
+        flags = manager.handleWayTags(osmWay, map, 0);
         assertEquals(singleSpeed, bike.getSpeed(flags), 1e-2);
         assertEquals(singleSpeed, bike.getSpeed(true, flags), 1e-2);
 
@@ -283,7 +288,9 @@ public class EncodingManagerTest {
             ReaderWay way = new ReaderWay(1);
             way.setTag("highway", "primary");
             way.setTag("junction", "roundabout");
-            IntsRef edgeFlags = manager.handleWayTags(way, encoder.acceptBit, 0);
+            EncodingManager.AcceptWay aw = new EncodingManager.AcceptWay();
+            manager.acceptWay(way, aw);
+            IntsRef edgeFlags = manager.handleWayTags(way, aw, 0);
             assertTrue(accessEnc.getBool(false, edgeFlags));
             if (!encoder.toString().equals("foot"))
                 assertFalse(encoder.toString(), accessEnc.getBool(true, edgeFlags));
@@ -292,7 +299,9 @@ public class EncodingManagerTest {
             way.clearTags();
             way.setTag("highway", "tertiary");
             way.setTag("junction", "circular");
-            edgeFlags = manager.handleWayTags(way, encoder.acceptBit, 0);
+            aw = new EncodingManager.AcceptWay();
+            manager.acceptWay(way, aw);
+            edgeFlags = manager.handleWayTags(way, aw, 0);
             assertTrue(accessEnc.getBool(false, edgeFlags));
             if (!encoder.toString().equals("foot"))
                 assertFalse(encoder.toString(), accessEnc.getBool(true, edgeFlags));
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 11a1283a2..57c4a45b1 100644
--- a/core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java
@@ -110,117 +110,117 @@ public class FootFlagEncoderTest {
 
         way.setTag("highway", "motorway");
         way.setTag("sidewalk", "yes");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
         way.setTag("sidewalk", "left");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
 
         way.setTag("sidewalk", "none");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "tertiary");
         way.setTag("sidewalk", "left");
         way.setTag("access", "private");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
         way.clearTags();
 
         way.setTag("highway", "pedestrian");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
 
         way.setTag("highway", "footway");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
 
         way.setTag("highway", "motorway");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
 
         way.setTag("highway", "path");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
 
         way.setTag("bicycle", "official");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
         way.setTag("foot", "no");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
 
         way.setTag("foot", "official");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "no");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
         way.setTag("foot", "yes");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("vehicle", "no");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
         way.setTag("foot", "no");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "tertiary");
         way.setTag("motorroad", "yes");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "cycleway");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
         way.setTag("foot", "no");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
         way.setTag("access", "yes");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("foot", "yes");
         way.setTag("access", "no");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "track");
         way.setTag("ford", "yes");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
         way.setTag("foot", "yes");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("route", "ferry");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isFerry());
         way.setTag("foot", "no");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
 
         DateFormat simpleDateFormat = Helper.createFormatter("yyyy MMM dd");
 
         way.clearTags();
         way.setTag("highway", "footway");
         way.setTag("access:conditional", "no @ (" + simpleDateFormat.format(new Date().getTime()) + ")");
-        assertFalse(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "footway");
         way.setTag("access", "no");
         way.setTag("access:conditional", "yes @ (" + simpleDateFormat.format(new Date().getTime()) + ")");
-        assertTrue(footEncoder.acceptWay(way) > 0);
+        assertTrue(footEncoder.getAccess(way).isWay());
     }
 
     @Test
     public void testRailPlatformIssue366() {
         ReaderWay way = new ReaderWay(1);
         way.setTag("railway", "platform");
-        IntsRef flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.acceptWay(way), 0);
+        IntsRef flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.getAccess(way), 0);
         assertNotEquals(0, flags.ints[0]);
 
         way.clearTags();
         way.setTag("highway", "track");
         way.setTag("railway", "platform");
-        flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.acceptWay(way), 0);
+        flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.getAccess(way), 0);
         assertNotEquals(0, flags.ints[0]);
 
         way.clearTags();
         // only tram, no highway => no access
         way.setTag("railway", "tram");
-        flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.acceptWay(way), 0);
+        flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.getAccess(way), 0);
         assertEquals(0, flags.ints[0]);
     }
 
@@ -228,7 +228,7 @@ public class FootFlagEncoderTest {
     public void testPier() {
         ReaderWay way = new ReaderWay(1);
         way.setTag("man_made", "pier");
-        IntsRef flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.acceptWay(way), 0);
+        IntsRef flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.getAccess(way), 0);
         assertNotEquals(0, flags.ints[0]);
     }
 
@@ -238,7 +238,7 @@ public class FootFlagEncoderTest {
         way.setTag("route", "ferry");
         // a bit longer than an hour
         way.setTag("duration:seconds", "4000");
-        IntsRef flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.acceptWay(way), 0);
+        IntsRef flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.getAccess(way), 0);
         assertTrue(footEncoder.getSpeed(flags) > footEncoder.getMaxSpeed());
         assertEquals(20, footEncoder.getSpeed(flags), .1);
     }
@@ -247,16 +247,16 @@ public class FootFlagEncoderTest {
     public void testMixSpeedAndSafe() {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "motorway");
-        IntsRef flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.acceptWay(way), 0);
+        IntsRef flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.getAccess(way), 0);
         assertEquals(0, flags.ints[0]);
 
         way.setTag("sidewalk", "yes");
-        flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.acceptWay(way), 0);
+        flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.getAccess(way), 0);
         assertEquals(5, footEncoder.getSpeed(flags), 1e-1);
 
         way.clearTags();
         way.setTag("highway", "track");
-        flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.acceptWay(way), 0);
+        flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.getAccess(way), 0);
         assertEquals(5, footEncoder.getSpeed(flags), 1e-1);
     }
 
@@ -316,12 +316,12 @@ public class FootFlagEncoderTest {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "track");
         way.setTag("sac_scale", "hiking");
-        IntsRef flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.acceptWay(way), 0);
+        IntsRef flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.getAccess(way), 0);
         assertEquals(FootFlagEncoder.MEAN_SPEED, footEncoder.getSpeed(flags), 1e-1);
 
         way.setTag("highway", "track");
         way.setTag("sac_scale", "mountain_hiking");
-        flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.acceptWay(way), 0);
+        flags = footEncoder.handleWayTags(encodingManager.createEdgeFlags(), way, footEncoder.getAccess(way), 0);
         assertEquals(FootFlagEncoder.SLOW_SPEED, footEncoder.getSpeed(flags), 1e-1);
     }
 
diff --git a/core/src/test/java/com/graphhopper/routing/util/HikeFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/HikeFlagEncoderTest.java
index 0fa5a04de..23a5164da 100644
--- a/core/src/test/java/com/graphhopper/routing/util/HikeFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/HikeFlagEncoderTest.java
@@ -20,10 +20,9 @@ package com.graphhopper.routing.util;
 import com.graphhopper.reader.ReaderWay;
 import org.junit.Test;
 
-import java.io.Reader;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * @author Peter Karich
@@ -39,7 +38,7 @@ public class HikeFlagEncoderTest {
         way.setTag("access", "no");
         way.setTag("sidewalk", "both");
         way.setTag("foot", "no");
-        assertFalse(hikeEncoder.acceptWay(way) > 0);
+        assertTrue(hikeEncoder.getAccess(way).canSkip());
     }
 
     @Test
diff --git a/core/src/test/java/com/graphhopper/routing/util/MotorcycleFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/MotorcycleFlagEncoderTest.java
index b0dc75b07..33a0b7739 100644
--- a/core/src/test/java/com/graphhopper/routing/util/MotorcycleFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/MotorcycleFlagEncoderTest.java
@@ -56,83 +56,80 @@ public class MotorcycleFlagEncoderTest {
     @Test
     public void testAccess() {
         ReaderWay way = new ReaderWay(1);
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("highway", "service");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
         way.setTag("access", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "track");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "delivery");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "unclassified");
         way.setTag("ford", "yes");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
         way.setTag("motorcycle", "yes");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.clearTags();
         way.setTag("route", "ferry");
-        assertTrue(encoder.acceptWay(way) > 0);
-        assertTrue(encoder.isFerry(encoder.acceptWay(way)));
+        assertTrue(encoder.getAccess(way).isFerry());
         way.setTag("motorcycle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("route", "ferry");
         way.setTag("foot", "yes");
-        assertFalse(encoder.acceptWay(way) > 0);
-        assertFalse(encoder.isFerry(encoder.acceptWay(way)));
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("access", "yes");
         way.setTag("motor_vehicle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "yes");
         way.setTag("motor_vehicle", "no");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("access", "emergency");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "service");
         way.setTag("motor_vehicle", "emergency");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         DateFormat simpleDateFormat = Helper.createFormatter("yyyy MMM dd");
 
         way.clearTags();
         way.setTag("highway", "road");
         way.setTag("access:conditional", "no @ (" + simpleDateFormat.format(new Date().getTime()) + ")");
-        assertFalse(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.clearTags();
         way.setTag("highway", "road");
         way.setTag("access", "no");
         way.setTag("access:conditional", "yes @ (" + simpleDateFormat.format(new Date().getTime()) + ")");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
     }
 
     @Test
     public void testHandleWayTags() {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "service");
-        long flags = encoder.acceptWay(way);
-        assertTrue(flags > 0);
-        IntsRef edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, flags, 0);
+        assertTrue(encoder.getAccess(way).isWay());
+        IntsRef edgeFlags = encoder.handleWayTags(em.createEdgeFlags(), way, EncodingManager.Access.WAY, 0);
         assertEquals(20, encoder.getSpeed(edgeFlags), .1);
         assertEquals(20, encoder.getSpeed(true, edgeFlags), .1);
     }
@@ -170,8 +167,8 @@ public class MotorcycleFlagEncoderTest {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "primary");
         way.setTag("estimated_distance", estimatedDistance);
-        long includeWay = encoder.acceptWay(way);
-        IntsRef flags = encoder.handleWayTags(em.createEdgeFlags(), way, includeWay, 0);
+        assertTrue(encoder.getAccess(way).isWay());
+        IntsRef flags = encoder.handleWayTags(em.createEdgeFlags(), way, EncodingManager.Access.WAY, 0);
         edge.setFlags(flags);
         encoder.applyWayTags(way, edge);
         DecimalEncodedValue curvatureEnc = encoder.getDecimalEncodedValue(EncodingManager.getKey(encoder, "curvature"));
diff --git a/core/src/test/java/com/graphhopper/routing/util/MountainBikeFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/MountainBikeFlagEncoderTest.java
index f5d60fe13..4565f280e 100644
--- a/core/src/test/java/com/graphhopper/routing/util/MountainBikeFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/MountainBikeFlagEncoderTest.java
@@ -88,17 +88,17 @@ public class MountainBikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "service");
         way.setTag("sac_scale", "hiking");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("highway", "service");
         way.setTag("sac_scale", "mountain_hiking");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("sac_scale", "alpine_hiking");
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         way.setTag("sac_scale", "demanding_alpine_hiking");
-        assertTrue(encoder.acceptWay(way) == 0);
+        assertTrue(encoder.getAccess(way).canSkip());
     }
 
     @Test
@@ -153,12 +153,11 @@ public class MountainBikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
     public void testHandleWayTagsInfluencedByRelation() {
         ReaderWay osmWay = new ReaderWay(1);
         osmWay.setTag("highway", "track");
-        long allowed = encoder.acceptBit;
 
         ReaderRelation osmRel = new ReaderRelation(1);
         long relFlags = encoder.handleRelationTags(0, osmRel);
         // unchanged
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(18, encoder.getSpeed(flags), 1e-1);
         assertPriority(PriorityCode.PREFER.getValue(), osmWay);
         assertEquals("small way, unpaved", getWayTypeFromFlags(osmWay));
@@ -167,22 +166,23 @@ public class MountainBikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         osmRel.setTag("route", "bicycle");
         osmRel.setTag("network", "lcn");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(18, encoder.getSpeed(flags), 1e-1);
         assertPriority(PriorityCode.PREFER.getValue(), osmWay);
         assertEquals("small way, unpaved", getWayTypeFromFlags(osmWay));
 
         // relation code is PREFER
         osmRel.setTag("network", "rcn");
+
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertPriority(PriorityCode.PREFER.getValue(), osmWay);
         assertEquals(18, encoder.getSpeed(flags), 1e-1);
 
         // relation code is PREFER
         osmRel.setTag("network", "ncn");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertPriority(PriorityCode.PREFER.getValue(), osmWay);
         assertEquals(18, encoder.getSpeed(flags), 1e-1);
 
@@ -194,7 +194,7 @@ public class MountainBikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         osmRel.setTag("route", "bicycle");
         osmRel.setTag("network", "lcn");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(18, encoder.getSpeed(flags), 1e-1);
         assertPriority(PriorityCode.PREFER.getValue(), osmWay);
         assertEquals("", getWayTypeFromFlags(osmWay));
diff --git a/core/src/test/java/com/graphhopper/routing/util/RacingBikeFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/RacingBikeFlagEncoderTest.java
index 5875c9b8e..b206b9001 100644
--- a/core/src/test/java/com/graphhopper/routing/util/RacingBikeFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/RacingBikeFlagEncoderTest.java
@@ -73,24 +73,22 @@ public class RacingBikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "service");
         way.setTag("sac_scale", "mountain_hiking");
-        // disallow
-        assertEquals(0, encoder.acceptWay(way));
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.setTag("highway", "path");
         way.setTag("sac_scale", "hiking");
-        // disallow
-        assertEquals(0, encoder.acceptWay(way));
+        assertTrue(encoder.getAccess(way).canSkip());
 
         way.setTag("highway", "cycleway");
         way.setTag("sac_scale", "hiking");
         // but allow this as there is no reason for not allowing it
-        assertTrue(encoder.acceptWay(way) > 0);
+        assertTrue(encoder.getAccess(way).isWay());
 
         // This looks to be tagging error:
         way.setTag("highway", "cycleway");
         way.setTag("sac_scale", "mountain_hiking");
-        // we are coutious and disallow this
-        assertEquals(0, encoder.acceptWay(way));
+        // we are cautious and disallow this
+        assertTrue(encoder.getAccess(way).canSkip());
     }
 
     @Test
@@ -135,12 +133,11 @@ public class RacingBikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         assertEquals("small way, unpaved", getWayTypeFromFlags(osmWay, 0));
 
         // relation code is PREFER
-        long allowed = encoder.acceptBit;
         ReaderRelation osmRel = new ReaderRelation(1);
         osmRel.setTag("route", "bicycle");
         osmRel.setTag("network", "lcn");
         long relFlags = encoder.handleRelationTags(0, osmRel);
-        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        IntsRef flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(2, encoder.getSpeed(flags), 1e-1);
         assertPriority(AVOID_AT_ALL_COSTS.getValue(), osmWay, relFlags);
         assertEquals("small way, unpaved", getWayTypeFromFlags(osmWay, relFlags));
@@ -148,21 +145,21 @@ public class RacingBikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         // relation code is OUTSTANDING NICE but as unpaved, the speed is still PUSHING_SECTION_SPEED/2
         osmRel.setTag("network", "icn");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(2, encoder.getSpeed(flags), 1e-1);
         assertPriority(AVOID_AT_ALL_COSTS.getValue(), osmWay, relFlags);
 
         // Now we assume bicycle=yes, anyhow still unpaved
         osmWay.setTag("bicycle", "yes");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(2, encoder.getSpeed(flags), 1e-1);
         assertPriority(AVOID_AT_ALL_COSTS.getValue(), osmWay, relFlags);
 
         // Now we assume bicycle=yes, and paved
         osmWay.setTag("tracktype", "grade1");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(20, encoder.getSpeed(flags), 1e-1);
         assertPriority(PREFER.getValue(), osmWay, relFlags);
         assertEquals("cycleway", getWayTypeFromFlags(osmWay, relFlags));
@@ -171,7 +168,7 @@ public class RacingBikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         osmWay.setTag("tracktype", "grade2");
         osmWay.setTag("bicycle", "yes");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(10, encoder.getSpeed(flags), 1e-1);
         assertPriority(AVOID_AT_ALL_COSTS.getValue(), osmWay, relFlags);
         assertEquals("small way, unpaved", getWayTypeFromFlags(osmWay, relFlags));
@@ -182,7 +179,7 @@ public class RacingBikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         osmWay.setTag("highway", "track");
         osmWay.setTag("tracktype", "grade3");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(PUSHING_SECTION_SPEED, encoder.getSpeed(flags), 1e-1);
         assertPriority(AVOID_AT_ALL_COSTS.getValue(), osmWay, relFlags);
         assertEquals("get off the bike, unpaved", getWayTypeFromFlags(osmWay, relFlags));
@@ -192,7 +189,7 @@ public class RacingBikeFlagEncoderTest extends AbstractBikeFlagEncoderTester {
         osmWay.clearTags();
         osmWay.setTag("highway", "track");
         relFlags = encoder.handleRelationTags(0, osmRel);
-        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, allowed, relFlags);
+        flags = encoder.handleWayTags(encodingManager.createEdgeFlags(), osmWay, EncodingManager.Access.WAY, relFlags);
         assertEquals(2, encoder.getSpeed(flags), 1e-1);
         assertPriority(AVOID_AT_ALL_COSTS.getValue(), osmWay, relFlags);
         assertEquals("small way, unpaved", getWayTypeFromFlags(osmWay, relFlags));
diff --git a/core/src/test/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupArrayTest.java b/core/src/test/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupArrayTest.java
index 67e0fd8d2..525bbfa34 100644
--- a/core/src/test/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupArrayTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupArrayTest.java
@@ -52,9 +52,9 @@ public class SpatialRuleLookupArrayTest {
 
         SpatialRuleLookup spatialRuleLookup = new SpatialRuleLookupArray(spatialRules, 1, false, new BBox(1, 4, 1, 4));
 
-        Assert.assertEquals(AccessValue.EVENTUALLY_ACCESSIBLE, spatialRuleLookup.lookupRule(1.2, 1.7).getAccessValue(null, TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
-        assertEquals(AccessValue.EVENTUALLY_ACCESSIBLE, spatialRuleLookup.lookupRule(1.2, 3.7).getAccessValue(null, TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
-        assertEquals(AccessValue.ACCESSIBLE, spatialRuleLookup.lookupRule(2.2, 1.7).getAccessValue(null, TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
+        assertEquals(SpatialRule.Access.CONDITIONAL, spatialRuleLookup.lookupRule(1.2, 1.7).getAccess(null, TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
+        assertEquals(SpatialRule.Access.CONDITIONAL, spatialRuleLookup.lookupRule(1.2, 3.7).getAccess(null, TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
+        assertEquals(SpatialRule.Access.YES, spatialRuleLookup.lookupRule(2.2, 1.7).getAccess(null, TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
     }
 
     @Test
@@ -66,11 +66,11 @@ public class SpatialRuleLookupArrayTest {
 
         SpatialRuleLookup spatialRuleLookup = new SpatialRuleLookupArray(spatialRules, 1, true, new BBox(-1, 4, 1, 4));
 
-        assertEquals(AccessValue.EVENTUALLY_ACCESSIBLE, spatialRuleLookup.lookupRule(1.2, 1.7).getAccessValue(null, TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
-        assertEquals(AccessValue.EVENTUALLY_ACCESSIBLE, spatialRuleLookup.lookupRule(1.2, 3.7).getAccessValue(null, TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
+        assertEquals(SpatialRule.Access.CONDITIONAL, spatialRuleLookup.lookupRule(1.2, 1.7).getAccess(null, TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
+        assertEquals(SpatialRule.Access.CONDITIONAL, spatialRuleLookup.lookupRule(1.2, 3.7).getAccess(null, TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
         // Not in the second Polygon anymore
-        assertEquals(AccessValue.ACCESSIBLE, spatialRuleLookup.lookupRule(3.9, 3.7).getAccessValue(null, TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
-        assertEquals(AccessValue.ACCESSIBLE, spatialRuleLookup.lookupRule(2.2, 1.7).getAccessValue(null, TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
+        assertEquals(SpatialRule.Access.YES, spatialRuleLookup.lookupRule(3.9, 3.7).getAccess(null, TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
+        assertEquals(SpatialRule.Access.YES, spatialRuleLookup.lookupRule(2.2, 1.7).getAccess(null, TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
         // Get the EmptySpatialRule in a BorderTile #1077
         assertEquals(SpatialRule.EMPTY.getId(), spatialRuleLookup.lookupRule(0.9, 0.9).getId());
     }
@@ -159,8 +159,8 @@ public class SpatialRuleLookupArrayTest {
             }
 
             @Override
-            public AccessValue getAccessValue(String highwayTag, TransportationMode transportationMode, AccessValue _default) {
-                return AccessValue.EVENTUALLY_ACCESSIBLE;
+            public Access getAccess(String highwayTag, TransportationMode transportationMode, Access _default) {
+                return Access.CONDITIONAL;
             }
 
             @Override
diff --git a/core/src/test/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupBuilderTest.java b/core/src/test/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupBuilderTest.java
index 93b635d82..e26a2b437 100644
--- a/core/src/test/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupBuilderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupBuilderTest.java
@@ -43,17 +43,17 @@ public class SpatialRuleLookupBuilderTest {
         SpatialRuleLookup spatialRuleLookup = SpatialRuleLookupBuilder.buildIndex(Jackson.newObjectMapper().readValue(reader, JsonFeatureCollection.class), "ISO_A3", new CountriesSpatialRuleFactory());
 
         // Berlin
-        Assert.assertEquals(AccessValue.EVENTUALLY_ACCESSIBLE, spatialRuleLookup.lookupRule(52.5243700, 13.4105300).getAccessValue("track", TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
-        assertEquals(AccessValue.ACCESSIBLE, spatialRuleLookup.lookupRule(52.5243700, 13.4105300).getAccessValue("primary", TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
+        assertEquals(SpatialRule.Access.CONDITIONAL, spatialRuleLookup.lookupRule(52.5243700, 13.4105300).getAccess("track", TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
+        assertEquals(SpatialRule.Access.YES, spatialRuleLookup.lookupRule(52.5243700, 13.4105300).getAccess("primary", TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
 
         // Paris -> empty rule
-        assertEquals(AccessValue.ACCESSIBLE, spatialRuleLookup.lookupRule(48.864716, 2.349014).getAccessValue("track", TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
-        assertEquals(AccessValue.ACCESSIBLE, spatialRuleLookup.lookupRule(48.864716, 2.349014).getAccessValue("primary", TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
+        assertEquals(SpatialRule.Access.YES, spatialRuleLookup.lookupRule(48.864716, 2.349014).getAccess("track", TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
+        assertEquals(SpatialRule.Access.YES, spatialRuleLookup.lookupRule(48.864716, 2.349014).getAccess("primary", TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
 
         // Vienna
-        assertEquals(AccessValue.ACCESSIBLE, spatialRuleLookup.lookupRule(48.210033, 16.363449).getAccessValue("track", TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
-        assertEquals(AccessValue.ACCESSIBLE, spatialRuleLookup.lookupRule(48.210033, 16.363449).getAccessValue("primary", TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
-        assertEquals(AccessValue.EVENTUALLY_ACCESSIBLE, spatialRuleLookup.lookupRule(48.210033, 16.363449).getAccessValue("living_street", TransportationMode.MOTOR_VEHICLE, AccessValue.ACCESSIBLE));
+        assertEquals(SpatialRule.Access.YES, spatialRuleLookup.lookupRule(48.210033, 16.363449).getAccess("track", TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
+        assertEquals(SpatialRule.Access.YES, spatialRuleLookup.lookupRule(48.210033, 16.363449).getAccess("primary", TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
+        assertEquals(SpatialRule.Access.CONDITIONAL, spatialRuleLookup.lookupRule(48.210033, 16.363449).getAccess("living_street", TransportationMode.MOTOR_VEHICLE, SpatialRule.Access.YES));
     }
 
     @Test
@@ -84,5 +84,4 @@ public class SpatialRuleLookupBuilderTest {
         assertEquals(SpatialRuleLookup.EMPTY, spatialRuleLookup);
     }
 
-
 }
diff --git a/core/src/test/java/com/graphhopper/routing/weighting/GenericWeightingTest.java b/core/src/test/java/com/graphhopper/routing/weighting/GenericWeightingTest.java
index a525a0480..5aa1f0f47 100644
--- a/core/src/test/java/com/graphhopper/routing/weighting/GenericWeightingTest.java
+++ b/core/src/test/java/com/graphhopper/routing/weighting/GenericWeightingTest.java
@@ -66,7 +66,7 @@ public class GenericWeightingTest {
         graph.edge(0, 1, 1, true);
         AbstractRoutingAlgorithmTester.updateDistancesFor(graph, 0, 0.00, 0.00);
         AbstractRoutingAlgorithmTester.updateDistancesFor(graph, 1, 0.01, 0.01);
-        graph.getEdgeIteratorState(0, 1).setFlags(encoder.handleWayTags(em.createEdgeFlags(), way, 1, 0));
+        graph.getEdgeIteratorState(0, 1).setFlags(encoder.handleWayTags(em.createEdgeFlags(), way, EncodingManager.Access.WAY, 0));
     }
 
     @Test
@@ -101,7 +101,8 @@ public class GenericWeightingTest {
         simpleGraph.edge(0, 1, 1, true);
         AbstractRoutingAlgorithmTester.updateDistancesFor(simpleGraph, 0, 0.00, 0.00);
         AbstractRoutingAlgorithmTester.updateDistancesFor(simpleGraph, 1, 0.01, 0.01);
-        simpleGraph.getEdgeIteratorState(0, 1).setFlags(simpleEncoder.handleWayTags(simpleEncodingManager.createEdgeFlags(), way, 1, 0));
+        simpleGraph.getEdgeIteratorState(0, 1).setFlags(simpleEncoder.handleWayTags(simpleEncodingManager.createEdgeFlags(), way,
+                EncodingManager.Access.WAY, 0));
 
         Weighting instance = new GenericWeighting(simpleEncoder, new HintsMap().put(GenericWeighting.HEIGHT_LIMIT, 5.0));
         EdgeIteratorState edge = simpleGraph.getEdgeIteratorState(0, 1);
diff --git a/core/src/test/java/com/graphhopper/storage/GraphHopperStorageForDataFlagEncoderTest.java b/core/src/test/java/com/graphhopper/storage/GraphHopperStorageForDataFlagEncoderTest.java
index aa334adde..cc9cfd876 100644
--- a/core/src/test/java/com/graphhopper/storage/GraphHopperStorageForDataFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/storage/GraphHopperStorageForDataFlagEncoderTest.java
@@ -5,6 +5,7 @@ import com.graphhopper.reader.ReaderWay;
 import com.graphhopper.routing.AbstractRoutingAlgorithmTester;
 import com.graphhopper.routing.util.DataFlagEncoder;
 import com.graphhopper.routing.util.EncodingManager;
+import com.graphhopper.routing.util.EncodingManager.Access;
 import com.graphhopper.routing.util.FlagEncoder;
 import com.graphhopper.util.Helper;
 import com.graphhopper.util.PMap;
@@ -63,7 +64,7 @@ public class GraphHopperStorageForDataFlagEncoderTest {
         graph.edge(0, 1, 1, true);
         AbstractRoutingAlgorithmTester.updateDistancesFor(graph, 0, 0.00, 0.00);
         AbstractRoutingAlgorithmTester.updateDistancesFor(graph, 1, 0.01, 0.01);
-        graph.getEdgeIteratorState(0, 1).setFlags(encoder.handleWayTags(encodingManager.createEdgeFlags(), way_0_1, 1, 0));
+        graph.getEdgeIteratorState(0, 1).setFlags(encoder.handleWayTags(encodingManager.createEdgeFlags(), way_0_1, Access.WAY, 0));
 
         // 1-2
         ReaderWay way_1_2 = new ReaderWay(28l);
@@ -72,7 +73,7 @@ public class GraphHopperStorageForDataFlagEncoderTest {
 
         graph.edge(1, 2, 1, true);
         AbstractRoutingAlgorithmTester.updateDistancesFor(graph, 2, 0.02, 0.02);
-        graph.getEdgeIteratorState(1, 2).setFlags(encoder.handleWayTags(encodingManager.createEdgeFlags(), way_1_2, 1, 0));
+        graph.getEdgeIteratorState(1, 2).setFlags(encoder.handleWayTags(encodingManager.createEdgeFlags(), way_1_2, Access.WAY, 0));
 
         // 2-0
         ReaderWay way_2_0 = new ReaderWay(29l);
@@ -80,7 +81,7 @@ public class GraphHopperStorageForDataFlagEncoderTest {
         way_2_0.setTag("maxwidth", "5");
 
         graph.edge(2, 0, 1, true);
-        graph.getEdgeIteratorState(2, 0).setFlags(encoder.handleWayTags(encodingManager.createEdgeFlags(), way_2_0, 1, 0));
+        graph.getEdgeIteratorState(2, 0).setFlags(encoder.handleWayTags(encodingManager.createEdgeFlags(), way_2_0, Access.WAY, 0));
 
         graph.flush();
         graph.close();
diff --git a/core/src/test/java/com/graphhopper/storage/GraphHopperStorageLMTest.java b/core/src/test/java/com/graphhopper/storage/GraphHopperStorageLMTest.java
index 1dc42b9a4..e7fdb3c55 100644
--- a/core/src/test/java/com/graphhopper/storage/GraphHopperStorageLMTest.java
+++ b/core/src/test/java/com/graphhopper/storage/GraphHopperStorageLMTest.java
@@ -5,6 +5,7 @@ import com.graphhopper.reader.ReaderWay;
 import com.graphhopper.routing.AbstractRoutingAlgorithmTester;
 import com.graphhopper.routing.util.CarFlagEncoder;
 import com.graphhopper.routing.util.EncodingManager;
+import com.graphhopper.routing.util.EncodingManager.Access;
 import com.graphhopper.util.Helper;
 import org.junit.Test;
 
@@ -32,7 +33,7 @@ public class GraphHopperStorageLMTest {
         graph.edge(0, 1, 1, true);
         AbstractRoutingAlgorithmTester.updateDistancesFor(graph, 0, 0.00, 0.00);
         AbstractRoutingAlgorithmTester.updateDistancesFor(graph, 1, 0.01, 0.01);
-        graph.getEdgeIteratorState(0, 1).setFlags(carFlagEncoder.handleWayTags(encodingManager.createEdgeFlags(), way_0_1, 1, 0));
+        graph.getEdgeIteratorState(0, 1).setFlags(carFlagEncoder.handleWayTags(encodingManager.createEdgeFlags(), way_0_1, Access.WAY, 0));
 
         // 1-2
         ReaderWay way_1_2 = new ReaderWay(28l);
@@ -41,7 +42,7 @@ public class GraphHopperStorageLMTest {
 
         graph.edge(1, 2, 1, true);
         AbstractRoutingAlgorithmTester.updateDistancesFor(graph, 2, 0.02, 0.02);
-        graph.getEdgeIteratorState(1, 2).setFlags(carFlagEncoder.handleWayTags(encodingManager.createEdgeFlags(), way_1_2, 1, 0));
+        graph.getEdgeIteratorState(1, 2).setFlags(carFlagEncoder.handleWayTags(encodingManager.createEdgeFlags(), way_1_2, Access.WAY, 0));
 
         graph.flush();
         graph.close();
diff --git a/core/src/test/java/com/graphhopper/util/InstructionListTest.java b/core/src/test/java/com/graphhopper/util/InstructionListTest.java
index 9bbbcdd86..10dfee10f 100644
--- a/core/src/test/java/com/graphhopper/util/InstructionListTest.java
+++ b/core/src/test/java/com/graphhopper/util/InstructionListTest.java
@@ -434,7 +434,9 @@ public class InstructionListTest {
         ReaderWay way = new ReaderWay(1);
         way.setTag("highway", "motorway");
         way.setTag("maxspeed", String.format("%d km/h", speedKmPerHour));
-        return encodingManager.handleWayTags(way, 1, 0);
+        EncodingManager.AcceptWay map = new EncodingManager.AcceptWay();
+        encodingManager.acceptWay(way, map);
+        return encodingManager.handleWayTags(way, map, 0);
     }
 
     @Test
diff --git a/core/src/test/java/com/graphhopper/util/PathSimplificationTest.java b/core/src/test/java/com/graphhopper/util/PathSimplificationTest.java
index 50d87ff25..479bb18a6 100644
--- a/core/src/test/java/com/graphhopper/util/PathSimplificationTest.java
+++ b/core/src/test/java/com/graphhopper/util/PathSimplificationTest.java
@@ -88,41 +88,43 @@ public class PathSimplificationTest {
 
         EdgeIteratorState tmpEdge;
         tmpEdge = g.edge(0, 1, 10000, true).setName("0-1");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        EncodingManager.AcceptWay map = new EncodingManager.AcceptWay();
+        assertTrue(carManager.acceptWay(w, map));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
         tmpEdge = g.edge(1, 2, 11000, true).setName("1-2");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
 
         w.setTag("maxspeed", "20");
         tmpEdge = g.edge(0, 3, 11000, true);
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
         tmpEdge = g.edge(1, 4, 10000, true).setName("1-4");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
         tmpEdge = g.edge(2, 5, 11000, true).setName("5-2");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
 
         w.setTag("maxspeed", "30");
         tmpEdge = g.edge(3, 6, 11000, true).setName("3-6");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
         tmpEdge = g.edge(4, 7, 10000, true).setName("4-7");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
         tmpEdge = g.edge(5, 8, 10000, true).setName("5-8");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
 
         w.setTag("maxspeed", "40");
         tmpEdge = g.edge(6, 7, 11000, true).setName("6-7");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
         tmpEdge = g.edge(7, 8, 10000, true);
         PointList list = new PointList();
         list.add(1.0, 1.15);
         list.add(1.0, 1.16);
         tmpEdge.setWayGeometry(list);
         tmpEdge.setName("7-8");
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
 
         w.setTag("maxspeed", "50");
         // missing edge name
         tmpEdge = g.edge(9, 10, 10000, true);
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
         tmpEdge = g.edge(8, 9, 20000, true);
         list.clear();
         list.add(1.0, 1.3);
@@ -131,7 +133,7 @@ public class PathSimplificationTest {
         list.add(1.0, 1.3003);
         tmpEdge.setName("8-9");
         tmpEdge.setWayGeometry(list);
-        tmpEdge.setFlags(carManager.handleWayTags(w, carManager.acceptWay(w), 0));
+        tmpEdge.setFlags(carManager.handleWayTags(w, map, 0));
 
         // Path is: [0 0-1, 3 1-4, 6 4-7, 9 7-8, 11 8-9, 10 9-10]
         Path p = new Dijkstra(g, new ShortestWeighting(carEncoder), tMode).calcPath(0, 10);