Repository: graphhopper/graphhopper
Pull request #1936 (2020-02-28 13:24:12)

access on private roads
if enabled it'll be still avoided similar to destination-only


Patch:
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 3dbc08c76..19620aac9 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -70,6 +70,7 @@ Here is an overview:
  * thehereward, code cleanups like #620
  * vvikas, ideas for many to many improvements and #616
  * zstadler, multiple fixes and car4wd
+ * samruston, improved point hint matching
 
 ## Translations
 
diff --git a/core/src/main/java/com/graphhopper/GraphHopper.java b/core/src/main/java/com/graphhopper/GraphHopper.java
index e20e24f94..79bf63d74 100644
--- a/core/src/main/java/com/graphhopper/GraphHopper.java
+++ b/core/src/main/java/com/graphhopper/GraphHopper.java
@@ -1168,9 +1168,9 @@ public class GraphHopper implements GraphHopperAPI {
         if (ROUND_TRIP.equalsIgnoreCase(algoStr))
             routingTemplate = new RoundTripRoutingTemplate(request, ghRsp, locationIndex, encodingManager, weighting, routingConfig.getMaxRoundTripRetries());
         else if (ALT_ROUTE.equalsIgnoreCase(algoStr))
-            routingTemplate = new AlternativeRoutingTemplate(request, ghRsp, locationIndex, encodingManager, weighting);
+            routingTemplate = new AlternativeRoutingTemplate(request, ghRsp, locationIndex, ghStorage.getNodeAccess(), encodingManager, weighting);
         else
-            routingTemplate = new ViaRoutingTemplate(request, ghRsp, locationIndex, encodingManager, weighting);
+            routingTemplate = new ViaRoutingTemplate(request, ghRsp, locationIndex, ghStorage.getNodeAccess(), encodingManager, weighting);
         return routingTemplate;
     }
 
diff --git a/core/src/main/java/com/graphhopper/routing/ch/CHPreparationHandler.java b/core/src/main/java/com/graphhopper/routing/ch/CHPreparationHandler.java
index e5dba1acc..fc13f0300 100644
--- a/core/src/main/java/com/graphhopper/routing/ch/CHPreparationHandler.java
+++ b/core/src/main/java/com/graphhopper/routing/ch/CHPreparationHandler.java
@@ -210,8 +210,8 @@ public class CHPreparationHandler {
     public void prepare(final StorableProperties properties, final boolean closeEarly) {
         ExecutorCompletionService<String> completionService = new ExecutorCompletionService<>(threadPool);
         int counter = 0;
-        for (final PrepareContractionHierarchies prepare : getPreparations()) {
-            LOGGER.info((++counter) + "/" + getPreparations().size() + " calling " +
+        for (final PrepareContractionHierarchies prepare : preparations) {
+            LOGGER.info((++counter) + "/" + preparations.size() + " calling " +
                     "CH prepare.doWork for " + prepare.getCHProfile() + " ... (" + getMemInfo() + ")");
             final String name = prepare.getCHProfile().toFileName();
             completionService.submit(new Runnable() {
@@ -231,7 +231,7 @@ public class CHPreparationHandler {
         threadPool.shutdown();
 
         try {
-            for (int i = 0; i < getPreparations().size(); i++) {
+            for (int i = 0; i < preparations.size(); i++) {
                 completionService.take().get();
             }
         } catch (Exception e) {
@@ -241,7 +241,7 @@ public class CHPreparationHandler {
     }
 
     public void createPreparations(GraphHopperStorage ghStorage) {
-        if (!isEnabled() || !getPreparations().isEmpty())
+        if (!isEnabled() || !preparations.isEmpty())
             return;
         if (!hasCHProfiles())
             throw new IllegalStateException("No CH profiles found");
diff --git a/core/src/main/java/com/graphhopper/routing/querygraph/QueryGraph.java b/core/src/main/java/com/graphhopper/routing/querygraph/QueryGraph.java
index 74709f85b..5c4b915e3 100644
--- a/core/src/main/java/com/graphhopper/routing/querygraph/QueryGraph.java
+++ b/core/src/main/java/com/graphhopper/routing/querygraph/QueryGraph.java
@@ -118,10 +118,6 @@ public class QueryGraph implements Graph {
         return baseGraph;
     }
 
-    public EdgeIteratorState getOriginalEdgeFromVirtNode(int nodeId) {
-        return getEdgeIteratorState(graphModification.getClosestEdges().get(nodeId - mainNodes), Integer.MIN_VALUE);
-    }
-
     public boolean isVirtualEdge(int edgeId) {
         return edgeId >= mainEdges;
     }
diff --git a/core/src/main/java/com/graphhopper/routing/template/AlternativeRoutingTemplate.java b/core/src/main/java/com/graphhopper/routing/template/AlternativeRoutingTemplate.java
index 0c99f3562..cc65d06df 100644
--- a/core/src/main/java/com/graphhopper/routing/template/AlternativeRoutingTemplate.java
+++ b/core/src/main/java/com/graphhopper/routing/template/AlternativeRoutingTemplate.java
@@ -26,6 +26,7 @@ import com.graphhopper.routing.RoutingAlgorithmFactory;
 import com.graphhopper.routing.profiles.EncodedValueLookup;
 import com.graphhopper.routing.querygraph.QueryGraph;
 import com.graphhopper.routing.weighting.Weighting;
+import com.graphhopper.storage.NodeAccess;
 import com.graphhopper.storage.index.LocationIndex;
 import com.graphhopper.storage.index.QueryResult;
 import com.graphhopper.util.Parameters.Routing;
@@ -46,8 +47,8 @@ import static com.graphhopper.util.Parameters.Routing.PASS_THROUGH;
  */
 final public class AlternativeRoutingTemplate extends ViaRoutingTemplate {
     public AlternativeRoutingTemplate(GHRequest ghRequest, GHResponse ghRsp, LocationIndex locationIndex,
-                                      EncodedValueLookup lookup, Weighting weighting) {
-        super(ghRequest, ghRsp, locationIndex, lookup, weighting);
+                                      NodeAccess nodeAccess, EncodedValueLookup lookup, Weighting weighting) {
+        super(ghRequest, ghRsp, locationIndex, nodeAccess, lookup, weighting);
     }
 
     @Override
diff --git a/core/src/main/java/com/graphhopper/routing/template/ViaRoutingTemplate.java b/core/src/main/java/com/graphhopper/routing/template/ViaRoutingTemplate.java
index 9bf21bf16..17a1f5f4b 100644
--- a/core/src/main/java/com/graphhopper/routing/template/ViaRoutingTemplate.java
+++ b/core/src/main/java/com/graphhopper/routing/template/ViaRoutingTemplate.java
@@ -30,6 +30,7 @@ import com.graphhopper.routing.util.EdgeFilter;
 import com.graphhopper.routing.util.NameSimilarityEdgeFilter;
 import com.graphhopper.routing.util.SnapPreventionEdgeFilter;
 import com.graphhopper.routing.weighting.Weighting;
+import com.graphhopper.storage.NodeAccess;
 import com.graphhopper.storage.index.LocationIndex;
 import com.graphhopper.storage.index.QueryResult;
 import com.graphhopper.util.*;
@@ -57,13 +58,15 @@ public class ViaRoutingTemplate extends AbstractRoutingTemplate implements Routi
     // result from route
     protected List<Path> pathList;
     protected final PathWrapper altResponse = new PathWrapper();
+    private final NodeAccess nodeAccess;
     private final EnumEncodedValue<RoadClass> roadClassEnc;
     private final EnumEncodedValue<RoadEnvironment> roadEnvEnc;
 
-    public ViaRoutingTemplate(GHRequest ghRequest, GHResponse ghRsp, LocationIndex locationIndex, EncodedValueLookup lookup, final Weighting weighting) {
+    public ViaRoutingTemplate(GHRequest ghRequest, GHResponse ghRsp, LocationIndex locationIndex, NodeAccess nodeAccess, EncodedValueLookup lookup, final Weighting weighting) {
         super(locationIndex, lookup, weighting);
         this.ghRequest = ghRequest;
         this.ghResponse = ghRsp;
+        this.nodeAccess = nodeAccess;
         this.roadClassEnc = lookup.getEnumEncodedValue(RoadClass.KEY, RoadClass.class);
         this.roadEnvEnc = lookup.getEnumEncodedValue(RoadEnvironment.KEY, RoadEnvironment.class);
     }
@@ -81,7 +84,7 @@ public class ViaRoutingTemplate extends AbstractRoutingTemplate implements Routi
             GHPoint point = points.get(placeIndex);
             QueryResult qr = null;
             if (ghRequest.hasPointHints())
-                qr = locationIndex.findClosest(point.lat, point.lon, new NameSimilarityEdgeFilter(strictEdgeFilter, ghRequest.getPointHints().get(placeIndex)));
+                qr = locationIndex.findClosest(point.lat, point.lon, new NameSimilarityEdgeFilter(strictEdgeFilter, nodeAccess, point, 100, ghRequest.getPointHints().get(placeIndex)));
             else if (ghRequest.hasSnapPreventions())
                 qr = locationIndex.findClosest(point.lat, point.lon, strictEdgeFilter);
             if (qr == null || !qr.isValid())
diff --git a/core/src/main/java/com/graphhopper/routing/util/Bike2WeightFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/Bike2WeightFlagEncoder.java
index b214010f5..d05521619 100644
--- a/core/src/main/java/com/graphhopper/routing/util/Bike2WeightFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/Bike2WeightFlagEncoder.java
@@ -36,20 +36,11 @@ public class Bike2WeightFlagEncoder extends BikeFlagEncoder {
         this(new PMap());
     }
 
-    public Bike2WeightFlagEncoder(String propertiesStr) {
-        this(new PMap(propertiesStr));
-    }
-
     public Bike2WeightFlagEncoder(PMap properties) {
         super(properties);
         speedTwoDirections = true;
     }
 
-    public Bike2WeightFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts) {
-        super(speedBits, speedFactor, maxTurnCosts);
-        speedTwoDirections = true;
-    }
-
     @Override
     public int getVersion() {
         return 3;
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 e8396cb36..f7fda07d7 100644
--- a/core/src/main/java/com/graphhopper/routing/util/BikeCommonFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/BikeCommonFlagEncoder.java
@@ -32,7 +32,6 @@ import static com.graphhopper.routing.util.PriorityCode.*;
 
 /**
  * Defines bit layout of bicycles (not motorcycles) for speed, access and relations (network).
- * <p>
  *
  * @author Peter Karich
  * @author Nop
@@ -49,7 +48,6 @@ abstract public class BikeCommonFlagEncoder extends AbstractFlagEncoder {
     protected final Set<String> unpavedSurfaceTags = new HashSet<>();
     private final Map<String, Integer> trackTypeSpeeds = new HashMap<>();
     private final Map<String, Integer> surfaceSpeeds = new HashMap<>();
-    private final Set<String> roadValues = new HashSet<>();
     private final Map<String, Integer> highwaySpeeds = new HashMap<>();
     protected boolean speedTwoDirections;
     DecimalEncodedValue priorityEnc;
@@ -61,16 +59,21 @@ abstract public class BikeCommonFlagEncoder extends AbstractFlagEncoder {
     // This is the specific bicycle class
     private String classBicycleKey;
 
-    protected BikeCommonFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts) {
+    protected BikeCommonFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts, boolean blockPrivate) {
         super(speedBits, speedFactor, maxTurnCosts);
         // strict set, usually vehicle and agricultural/forestry are ignored by cyclists
         restrictions.addAll(Arrays.asList("bicycle", "vehicle", "access"));
-        restrictedValues.add("private");
+
         restrictedValues.add("no");
         restrictedValues.add("restricted");
         restrictedValues.add("military");
         restrictedValues.add("emergency");
 
+        if (blockPrivate)
+            restrictedValues.add("private");
+        else
+            intendedValues.add("private");
+
         intendedValues.add("yes");
         intendedValues.add("designated");
         intendedValues.add("official");
@@ -105,20 +108,6 @@ abstract public class BikeCommonFlagEncoder extends AbstractFlagEncoder {
         unpavedSurfaceTags.add("sand");
         unpavedSurfaceTags.add("wood");
 
-        roadValues.add("living_street");
-        roadValues.add("road");
-        roadValues.add("service");
-        roadValues.add("unclassified");
-        roadValues.add("residential");
-        roadValues.add("trunk");
-        roadValues.add("trunk_link");
-        roadValues.add("primary");
-        roadValues.add("primary_link");
-        roadValues.add("secondary");
-        roadValues.add("secondary_link");
-        roadValues.add("tertiary");
-        roadValues.add("tertiary_link");
-
         maxPossibleSpeed = 30;
 
         setTrackTypeSpeed("grade1", 18); // paved
diff --git a/core/src/main/java/com/graphhopper/routing/util/BikeFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/BikeFlagEncoder.java
index 8a6d527fa..02986348c 100644
--- a/core/src/main/java/com/graphhopper/routing/util/BikeFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/BikeFlagEncoder.java
@@ -27,7 +27,7 @@ import com.graphhopper.util.PMap;
  */
 public class BikeFlagEncoder extends BikeCommonFlagEncoder {
     public BikeFlagEncoder() {
-        this(4, 2, 0);
+        this(4, 2, 0, true);
     }
 
     public BikeFlagEncoder(String propertiesString) {
@@ -37,12 +37,13 @@ public class BikeFlagEncoder extends BikeCommonFlagEncoder {
     public BikeFlagEncoder(PMap properties) {
         this(properties.getInt("speed_bits", 4),
                 properties.getInt("speed_factor", 2),
-                properties.getBool("turn_costs", false) ? 1 : 0);
+                properties.getBool("turn_costs", false) ? 1 : 0,
+                properties.getBool("block_private", true));
         this.setBlockFords(properties.getBool("block_fords", false));
     }
 
-    public BikeFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts) {
-        super(speedBits, speedFactor, maxTurnCosts);
+    public BikeFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts, boolean blockPrivate) {
+        super(speedBits, speedFactor, maxTurnCosts, blockPrivate);
         addPushingSection("path");
         addPushingSection("footway");
         addPushingSection("pedestrian");
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 3c4c59e2c..1e25491c5 100644
--- a/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java
@@ -49,26 +49,22 @@ public class CarFlagEncoder extends AbstractFlagEncoder {
     protected final Map<String, Integer> defaultSpeedMap = new HashMap<>();
 
     public CarFlagEncoder() {
-        this(5, 5, 0);
+        this(5, 5, 0, true);
     }
 
     public CarFlagEncoder(PMap properties) {
         this((int) properties.getLong("speed_bits", 5),
                 properties.getDouble("speed_factor", 5),
-                properties.getBool("turn_costs", false) ? 1 : 0);
+                properties.getBool("turn_costs", false) ? 1 : 0,
+                properties.getBool("block_private", true));
         this.speedTwoDirections = properties.getBool("speed_two_directions", false);
         this.setBlockFords(properties.getBool("block_fords", false));
         this.setBlockByDefault(properties.getBool("block_barriers", true));
     }
 
-    public CarFlagEncoder(String propertiesStr) {
-        this(new PMap(propertiesStr));
-    }
-
-    public CarFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts) {
+    public CarFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts, boolean blockPrivate) {
         super(speedBits, speedFactor, maxTurnCosts);
         restrictions.addAll(Arrays.asList("motorcar", "motor_vehicle", "vehicle", "access"));
-        restrictedValues.add("private");
         restrictedValues.add("agricultural");
         restrictedValues.add("forestry");
         restrictedValues.add("no");
@@ -77,6 +73,11 @@ public class CarFlagEncoder extends AbstractFlagEncoder {
         restrictedValues.add("military");
         restrictedValues.add("emergency");
 
+        if (blockPrivate)
+            restrictedValues.add("private");
+        else
+            intendedValues.add("private");
+
         intendedValues.add("yes");
         intendedValues.add("permissive");
 
diff --git a/core/src/main/java/com/graphhopper/routing/util/EncodedValueOld.java b/core/src/main/java/com/graphhopper/routing/util/EncodedValueOld.java
deleted file mode 100644
index f849854ab..000000000
--- a/core/src/main/java/com/graphhopper/routing/util/EncodedValueOld.java
+++ /dev/null
@@ -1,114 +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;
-
-/**
- * Encapsulates a bit-encoded value.
- *
- * @author Nop
- */
-public class EncodedValueOld {
-    protected final long shift;
-    protected final long mask;
-    protected final double factor;
-    protected final long defaultValue;
-    private final String name;
-    private final long maxValue;
-    private final boolean allowZero;
-    private final int bits;
-
-    /**
-     * Define a bit-encoded value
-     * <p>
-     *
-     * @param name         Description for debugging
-     * @param shift        bit index of this value
-     * @param bits         number of bits reserved
-     * @param factor       scaling factor for stored values
-     * @param defaultValue default value
-     * @param maxValue     default maximum value
-     */
-    public EncodedValueOld(String name, int shift, int bits, double factor, long defaultValue, int maxValue) {
-        this(name, shift, bits, factor, defaultValue, maxValue, true);
-    }
-
-    public EncodedValueOld(String name, int shift, int bits, double factor, long defaultValue, int maxValue, boolean allowZero) {
-        this.name = name;
-        this.shift = shift;
-        this.factor = factor;
-        this.defaultValue = defaultValue;
-        this.bits = bits;
-        long tmpMask = (1L << bits) - 1;
-        this.maxValue = Math.min(maxValue, Math.round(tmpMask * factor));
-        if (maxValue > this.maxValue)
-            throw new IllegalStateException(name + " -> maxValue " + maxValue + " is too large for " + bits + " bits");
-
-        double factorDivision = maxValue / factor;
-        if (factorDivision != (int) factorDivision) {
-            throw new IllegalStateException("MaxValue needs to be divisible by factor without remainder");
-        }
-
-        mask = tmpMask << shift;
-        this.allowZero = allowZero;
-    }
-
-    protected void checkValue(long value) {
-        if (value > maxValue)
-            throw new IllegalArgumentException(name + " value too large for encoding: " + value + ", maxValue:" + maxValue);
-        if (value < 0)
-            throw new IllegalArgumentException("negative " + name + " value not allowed! " + value);
-        if (!allowZero && value == 0)
-            throw new IllegalArgumentException("zero " + name + " value not allowed! " + value);
-    }
-
-    public long setValue(long flags, long value) {
-        // scale value
-        value = Math.round(value / factor);
-        checkValue((long) (value * factor));
-        value <<= shift;
-
-        // clear value bits
-        flags &= ~mask;
-
-        // set value
-        return flags | value;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public long getValue(long flags) {
-        // find value
-        flags &= mask;
-        flags >>>= shift;
-        return Math.round(flags * factor);
-    }
-
-    public int getBits() {
-        return bits;
-    }
-
-    public double getFactor() {
-        return factor;
-    }
-
-    public long setDefaultValue(long flags) {
-        return setValue(flags, defaultValue);
-    }
-}
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 80f98a7e3..44a0dd791 100644
--- a/core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java
@@ -59,29 +59,35 @@ public class FootFlagEncoder extends AbstractFlagEncoder {
      * Should be only instantiated via EncodingManager
      */
     public FootFlagEncoder() {
-        this(4, 1);
+        this(4, 1, true);
+    }
+
+    public FootFlagEncoder(String propertiesStr) {
+        this(new PMap(propertiesStr));
     }
 
     public FootFlagEncoder(PMap properties) {
         this((int) properties.getLong("speed_bits", 4),
-                properties.getDouble("speed_factor", 1));
+                properties.getDouble("speed_factor", 1),
+                properties.getBool("block_private", true));
         this.setBlockFords(properties.getBool("block_fords", false));
         this.speedTwoDirections = properties.getBool("speed_two_directions", false);
     }
 
-    public FootFlagEncoder(String propertiesStr) {
-        this(new PMap(propertiesStr));
-    }
-
-    public FootFlagEncoder(int speedBits, double speedFactor) {
+    protected FootFlagEncoder(int speedBits, double speedFactor, boolean blockPrivate) {
         super(speedBits, speedFactor, 0);
         restrictions.addAll(Arrays.asList("foot", "access"));
-        restrictedValues.add("private");
+
         restrictedValues.add("no");
         restrictedValues.add("restricted");
         restrictedValues.add("military");
         restrictedValues.add("emergency");
 
+        if (blockPrivate)
+            restrictedValues.add("private");
+        else
+            intendedValues.add("private");
+
         intendedValues.add("yes");
         intendedValues.add("designated");
         intendedValues.add("official");
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 19a8649eb..7d40d3656 100644
--- a/core/src/main/java/com/graphhopper/routing/util/HikeFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/HikeFlagEncoder.java
@@ -38,17 +38,18 @@ import static com.graphhopper.routing.util.PriorityCode.*;
 public class HikeFlagEncoder extends FootFlagEncoder {
 
     public HikeFlagEncoder() {
-        this(4, 1);
+        this(4, 1, true);
     }
 
     public HikeFlagEncoder(PMap properties) {
         this((int) properties.getLong("speed_bits", 4),
-                properties.getDouble("speed_factor", 1));
+                properties.getDouble("speed_factor", 1),
+                properties.getBool("block_private", true));
         this.setBlockFords(properties.getBool("block_fords", false));
     }
 
-    public HikeFlagEncoder(int speedBits, double speedFactor) {
-        super(speedBits, speedFactor);
+    protected HikeFlagEncoder(int speedBits, double speedFactor, boolean blockPrivate) {
+        super(speedBits, speedFactor, blockPrivate);
 
         routeMap.put(INTERNATIONAL, BEST.getValue());
         routeMap.put(NATIONAL, BEST.getValue());
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 4f5a5c354..df81c5a4f 100644
--- a/core/src/main/java/com/graphhopper/routing/util/MotorcycleFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/MotorcycleFlagEncoder.java
@@ -46,22 +46,19 @@ public class MotorcycleFlagEncoder extends CarFlagEncoder {
     private DecimalEncodedValue curvatureEncoder;
 
     public MotorcycleFlagEncoder() {
-        this(5, 5, 0);
+        this(5, 5, 0, true);
     }
 
     public MotorcycleFlagEncoder(PMap properties) {
         this(properties.getInt("speed_bits", 5),
                 properties.getDouble("speed_factor", 5),
-                properties.getBool("turn_costs", false) ? 1 : 0);
+                properties.getBool("turn_costs", false) ? 1 : 0,
+                properties.getBool("block_private", true));
         this.setBlockFords(properties.getBool("block_fords", false));
     }
 
-    public MotorcycleFlagEncoder(String propertiesStr) {
-        this(new PMap(propertiesStr));
-    }
-
-    public MotorcycleFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts) {
-        super(speedBits, speedFactor, maxTurnCosts);
+    public MotorcycleFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts, boolean blockPrivate) {
+        super(speedBits, speedFactor, maxTurnCosts, blockPrivate);
         speedTwoDirections = true;
         restrictions.remove("motorcar");
         //  moped, mofa
diff --git a/core/src/main/java/com/graphhopper/routing/util/MountainBikeFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/MountainBikeFlagEncoder.java
index 87d379e47..309ca9e04 100644
--- a/core/src/main/java/com/graphhopper/routing/util/MountainBikeFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/MountainBikeFlagEncoder.java
@@ -34,22 +34,19 @@ import static com.graphhopper.routing.util.PriorityCode.*;
  */
 public class MountainBikeFlagEncoder extends BikeCommonFlagEncoder {
     public MountainBikeFlagEncoder() {
-        this(4, 2, 0);
+        this(4, 2, 0, true);
     }
 
     public MountainBikeFlagEncoder(PMap properties) {
         this((int) properties.getLong("speed_bits", 4),
                 properties.getDouble("speed_factor", 2),
-                properties.getBool("turn_costs", false) ? 1 : 0);
+                properties.getBool("turn_costs", false) ? 1 : 0,
+                properties.getBool("block_private", true));
         this.setBlockFords(properties.getBool("block_fords", false));
     }
 
-    public MountainBikeFlagEncoder(String propertiesStr) {
-        this(new PMap(propertiesStr));
-    }
-
-    public MountainBikeFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts) {
-        super(speedBits, speedFactor, maxTurnCosts);
+    protected MountainBikeFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts, boolean blockPrivate) {
+        super(speedBits, speedFactor, maxTurnCosts, blockPrivate);
         setTrackTypeSpeed("grade1", 18); // paved
         setTrackTypeSpeed("grade2", 16); // now unpaved ...
         setTrackTypeSpeed("grade3", 12);
diff --git a/core/src/main/java/com/graphhopper/routing/util/NameSimilarityEdgeFilter.java b/core/src/main/java/com/graphhopper/routing/util/NameSimilarityEdgeFilter.java
index 145388953..7f6663bfd 100644
--- a/core/src/main/java/com/graphhopper/routing/util/NameSimilarityEdgeFilter.java
+++ b/core/src/main/java/com/graphhopper/routing/util/NameSimilarityEdgeFilter.java
@@ -19,7 +19,12 @@ package com.graphhopper.routing.util;
 
 import com.graphhopper.apache.commons.lang3.StringUtils;
 import com.graphhopper.debatty.java.stringsimilarity.JaroWinkler;
+import com.graphhopper.storage.GraphEdgeIdFinder;
+import com.graphhopper.storage.NodeAccess;
 import com.graphhopper.util.EdgeIteratorState;
+import com.graphhopper.util.shapes.BBox;
+import com.graphhopper.util.shapes.Circle;
+import com.graphhopper.util.shapes.GHPoint;
 
 import java.util.Arrays;
 import java.util.HashMap;
@@ -84,18 +89,23 @@ public class NameSimilarityEdgeFilter implements EdgeFilter {
     private final EdgeFilter edgeFilter;
     private final String pointHint;
     private final Map<String, String> rewriteMap;
+    private final Circle pointCircle;
+    private final NodeAccess nodeAccess;
 
-    public NameSimilarityEdgeFilter(EdgeFilter edgeFilter, String pointHint) {
-        this(edgeFilter, pointHint, DEFAULT_REWRITE_MAP);
+    public NameSimilarityEdgeFilter(EdgeFilter edgeFilter, NodeAccess nodeAccess, GHPoint point, double radius, String pointHint) {
+        this(edgeFilter, nodeAccess, pointHint, point, radius, DEFAULT_REWRITE_MAP);
     }
 
     /**
+     * @param radius the searchable region about the point in meters
      * @param rewriteMap maps abbreviations to its longer form
      */
-    public NameSimilarityEdgeFilter(EdgeFilter edgeFilter, String pointHint, Map<String, String> rewriteMap) {
+    public NameSimilarityEdgeFilter(EdgeFilter edgeFilter, NodeAccess nodeAccess, String pointHint, GHPoint point, double radius, Map<String, String> rewriteMap) {
         this.edgeFilter = edgeFilter;
         this.rewriteMap = rewriteMap;
+        this.nodeAccess = nodeAccess;
         this.pointHint = prepareName(removeRelation(pointHint == null ? "" : pointHint));
+        this.pointCircle = new Circle(point.lat, point.lon, radius);
     }
 
     String getNormalizedPointHint() {
@@ -148,11 +158,22 @@ public class NameSimilarityEdgeFilter implements EdgeFilter {
             return false;
         }
 
+        BBox bbox = createBBox(nodeAccess, iter);
+        if(!pointCircle.intersects(bbox)) {
+            return false;
+        }
+
         name = removeRelation(name);
         String edgeName = prepareName(name);
+
         return isJaroWinklerSimilar(pointHint, edgeName);
     }
 
+    private static BBox createBBox(NodeAccess na, EdgeIteratorState edgeState) {
+        return BBox.fromPoints(na.getLatitude(edgeState.getBaseNode()), na.getLongitude(edgeState.getBaseNode()),
+                na.getLatitude(edgeState.getAdjNode()), na.getLongitude(edgeState.getAdjNode()));
+    }
+
     private boolean isJaroWinklerSimilar(String str1, String str2) {
         double jwSimilarity = jaroWinkler.similarity(str1, str2);
         // System.out.println(str1 + " vs. edge:" + str2 + ", " + jwSimilarity);
diff --git a/core/src/main/java/com/graphhopper/routing/util/RacingBikeFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/RacingBikeFlagEncoder.java
index ae9b1eb5f..d95c26e7e 100644
--- a/core/src/main/java/com/graphhopper/routing/util/RacingBikeFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/RacingBikeFlagEncoder.java
@@ -18,7 +18,6 @@
 package com.graphhopper.routing.util;
 
 import com.graphhopper.reader.ReaderWay;
-import com.graphhopper.storage.IntsRef;
 import com.graphhopper.util.PMap;
 
 import java.util.TreeMap;
@@ -34,22 +33,19 @@ import static com.graphhopper.routing.util.PriorityCode.*;
  */
 public class RacingBikeFlagEncoder extends BikeCommonFlagEncoder {
     public RacingBikeFlagEncoder() {
-        this(4, 2, 0);
+        this(4, 2, 0, true);
     }
 
     public RacingBikeFlagEncoder(PMap properties) {
         this((int) properties.getLong("speed_bits", 4),
                 properties.getDouble("speed_factor", 2),
-                properties.getBool("turn_costs", false) ? 1 : 0);
+                properties.getBool("turn_costs", false) ? 1 : 0,
+                properties.getBool("block_private", true));
         this.setBlockFords(properties.getBool("block_fords", false));
     }
 
-    public RacingBikeFlagEncoder(String propertiesStr) {
-        this(new PMap(propertiesStr));
-    }
-
-    public RacingBikeFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts) {
-        super(speedBits, speedFactor, maxTurnCosts);
+    protected RacingBikeFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts, boolean blockPrivate) {
+        super(speedBits, speedFactor, maxTurnCosts, blockPrivate);
         preferHighwayTags.add("road");
         preferHighwayTags.add("secondary");
         preferHighwayTags.add("secondary_link");
diff --git a/core/src/main/java/com/graphhopper/routing/util/WheelchairFlagEncoder.java b/core/src/main/java/com/graphhopper/routing/util/WheelchairFlagEncoder.java
index 11585f348..80ee84a98 100644
--- a/core/src/main/java/com/graphhopper/routing/util/WheelchairFlagEncoder.java
+++ b/core/src/main/java/com/graphhopper/routing/util/WheelchairFlagEncoder.java
@@ -45,17 +45,18 @@ public class WheelchairFlagEncoder extends FootFlagEncoder {
      * Should be only instantiated via EncodingManager
      */
     public WheelchairFlagEncoder() {
-        this(4, 1);
+        this(4, 1, true);
     }
 
     public WheelchairFlagEncoder(PMap properties) {
         this((int) properties.getLong("speed_bits", 4),
-                properties.getDouble("speed_factor", 1));
+                properties.getDouble("speed_factor", 1),
+                properties.getBool("block_private", true));
         this.setBlockFords(properties.getBool("block_fords", false));
     }
 
-    public WheelchairFlagEncoder(int speedBits, double speedFactor) {
-        super(speedBits, speedFactor);
+    protected WheelchairFlagEncoder(int speedBits, double speedFactor, boolean blockPrivate) {
+        super(speedBits, speedFactor, blockPrivate);
         restrictions.add("wheelchair");
 
         setBlockByDefault(false);
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMGetOffBikeParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMGetOffBikeParser.java
index 22d435e64..fd7899b7b 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMGetOffBikeParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMGetOffBikeParser.java
@@ -21,12 +21,13 @@ public class OSMGetOffBikeParser implements TagParser {
     private final BooleanEncodedValue offBikeEnc;
 
     public OSMGetOffBikeParser() {
-        offBikeEnc = GetOffBike.create();
-        pushBikeHighwayTags.add("path");
-        // pushBikeHighwayTags.add("steps"); special handling
-        pushBikeHighwayTags.add("footway");
-        pushBikeHighwayTags.add("pedestrian");
-        pushBikeHighwayTags.add("platform");
+        // steps -> special handling
+        this(GetOffBike.create(), Arrays.asList("path", "footway", "pedestrian", "platform"));
+    }
+
+    public OSMGetOffBikeParser(BooleanEncodedValue enc, List<String> pushBikeTags) {
+        offBikeEnc = enc;
+        pushBikeHighwayTags.addAll(pushBikeTags);
     }
 
     @Override
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxSpeedParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxSpeedParser.java
index 441b27f68..de08833ee 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxSpeedParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMMaxSpeedParser.java
@@ -34,7 +34,7 @@ import static com.graphhopper.routing.profiles.MaxSpeed.UNSET_SPEED;
 
 public class OSMMaxSpeedParser implements TagParser {
 
-    private final DecimalEncodedValue carMaxSpeedEnc;
+    protected final DecimalEncodedValue carMaxSpeedEnc;
 
     public OSMMaxSpeedParser() {
         this(MaxSpeed.create());
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadAccessParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadAccessParser.java
index bd631583d..32b4094fe 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadAccessParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMRoadAccessParser.java
@@ -18,11 +18,7 @@
 package com.graphhopper.routing.util.parsers;
 
 import com.graphhopper.reader.ReaderWay;
-import com.graphhopper.routing.profiles.EncodedValue;
-import com.graphhopper.routing.profiles.EncodedValueLookup;
-import com.graphhopper.routing.profiles.EnumEncodedValue;
-import com.graphhopper.routing.profiles.RoadAccess;
-import com.graphhopper.routing.profiles.RoadClass;
+import com.graphhopper.routing.profiles.*;
 import com.graphhopper.routing.util.spatialrules.SpatialRule;
 import com.graphhopper.routing.util.spatialrules.TransportationMode;
 import com.graphhopper.storage.IntsRef;
@@ -33,15 +29,15 @@ import java.util.List;
 import static com.graphhopper.routing.profiles.RoadAccess.YES;
 
 public class OSMRoadAccessParser implements TagParser {
-    private final EnumEncodedValue<RoadAccess> roadAccessEnc;
+    protected final EnumEncodedValue<RoadAccess> roadAccessEnc;
     private final List<String> restrictions;
 
     public OSMRoadAccessParser() {
-        this(Arrays.asList("motorcar", "motor_vehicle", "vehicle", "access"));
+        this(new EnumEncodedValue<>(RoadAccess.KEY, RoadAccess.class), Arrays.asList("motorcar", "motor_vehicle", "vehicle", "access"));
     }
 
-    public OSMRoadAccessParser(List<String> restrictions) {
-        this.roadAccessEnc = new EnumEncodedValue<>(RoadAccess.KEY, RoadAccess.class);
+    public OSMRoadAccessParser(EnumEncodedValue<RoadAccess> roadAccessEnc, List<String> restrictions) {
+        this.roadAccessEnc = roadAccessEnc;
         this.restrictions = restrictions;
     }
 
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTollParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTollParser.java
index c3f1ef48d..e30ad74dd 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTollParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTollParser.java
@@ -31,7 +31,11 @@ public class OSMTollParser implements TagParser {
     private final EnumEncodedValue<Toll> tollEnc;
 
     public OSMTollParser() {
-        this.tollEnc = new EnumEncodedValue<>(Toll.KEY, Toll.class);
+        this(new EnumEncodedValue<>(Toll.KEY, Toll.class));
+    }
+
+    public OSMTollParser(EnumEncodedValue<Toll> tollEnc) {
+        this.tollEnc = tollEnc;
     }
 
     @Override
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParser.java
index d8e8f93a4..7bcb8ec23 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParser.java
@@ -39,7 +39,6 @@ import static com.graphhopper.routing.util.EncodingManager.getKey;
 public class OSMTurnRelationParser implements TurnCostParser {
     private String name;
     private DecimalEncodedValue turnCostEnc;
-    private final int maxTurnCosts;
     private final Collection<String> restrictions;
     private BooleanEncodedValue accessEnc;
     private EdgeExplorer cachedOutExplorer, cachedInExplorer;
@@ -54,7 +53,8 @@ public class OSMTurnRelationParser implements TurnCostParser {
 
     public OSMTurnRelationParser(String name, int maxTurnCosts, Collection<String> restrictions) {
         this.name = name;
-        this.maxTurnCosts = maxTurnCosts;
+        this.turnCostEnc = TurnCost.create(name, maxTurnCosts);
+
         if (restrictions.isEmpty()) {
             // https://wiki.openstreetmap.org/wiki/Key:access
             if (name.contains("car"))
@@ -74,8 +74,6 @@ public class OSMTurnRelationParser implements TurnCostParser {
     }
 
     DecimalEncodedValue getTurnCostEnc() {
-        if (turnCostEnc == null)
-            throw new IllegalStateException("Cannot access turn cost encoded value. Not initialized. Call createTurnCostEncodedValues before");
         return turnCostEnc;
     }
 
@@ -83,7 +81,7 @@ public class OSMTurnRelationParser implements TurnCostParser {
     public void createTurnCostEncodedValues(EncodedValueLookup lookup, List<EncodedValue> registerNewEncodedValue) {
         String accessKey = getKey(name, "access");
         accessEnc = lookup.getEncodedValue(accessKey, BooleanEncodedValue.class);
-        registerNewEncodedValue.add(turnCostEnc = TurnCost.create(name, maxTurnCosts));
+        registerNewEncodedValue.add(turnCostEnc);
     }
 
     @Override
@@ -104,8 +102,6 @@ public class OSMTurnRelationParser implements TurnCostParser {
 
     /**
      * Add the specified relation to the TurnCostStorage
-     *
-     * @return a collection of turn cost entries which can be used for testing
      */
     void addRelationToTCStorage(OSMTurnRelation osmTurnRelation, IntsRef turnCostFlags,
                                 ExternalInternalMap map, Graph graph) {
diff --git a/core/src/main/java/com/graphhopper/routing/util/parsers/SpatialRuleParser.java b/core/src/main/java/com/graphhopper/routing/util/parsers/SpatialRuleParser.java
index 7d8302819..b44947ad6 100644
--- a/core/src/main/java/com/graphhopper/routing/util/parsers/SpatialRuleParser.java
+++ b/core/src/main/java/com/graphhopper/routing/util/parsers/SpatialRuleParser.java
@@ -18,7 +18,9 @@
 package com.graphhopper.routing.util.parsers;
 
 import com.graphhopper.reader.ReaderWay;
-import com.graphhopper.routing.profiles.*;
+import com.graphhopper.routing.profiles.EncodedValue;
+import com.graphhopper.routing.profiles.EncodedValueLookup;
+import com.graphhopper.routing.profiles.IntEncodedValue;
 import com.graphhopper.routing.util.spatialrules.SpatialRule;
 import com.graphhopper.routing.util.spatialrules.SpatialRuleLookup;
 import com.graphhopper.storage.IntsRef;
@@ -36,13 +38,13 @@ public class SpatialRuleParser implements TagParser {
 
     public SpatialRuleParser(SpatialRuleLookup spatialRuleLookup, IntEncodedValue spatialRuleEnc) {
         this.spatialRuleLookup = spatialRuleLookup;
+        if (spatialRuleEnc == null)
+            throw new IllegalStateException("SpatialRuleLookup was not initialized before building the EncodingManager");
         this.spatialRuleEnc = spatialRuleEnc;
     }
 
     @Override
     public void createEncodedValues(EncodedValueLookup lookup, List<EncodedValue> registerNewEncodedValue) {
-        if (spatialRuleEnc == null)
-            throw new IllegalStateException("SpatialRuleLookup was not initialized before building the EncodingManager");
         registerNewEncodedValue.add(spatialRuleEnc);
     }
 
diff --git a/core/src/main/java/com/graphhopper/routing/weighting/DefaultTurnCostProvider.java b/core/src/main/java/com/graphhopper/routing/weighting/DefaultTurnCostProvider.java
index 936215203..bf7a649b6 100644
--- a/core/src/main/java/com/graphhopper/routing/weighting/DefaultTurnCostProvider.java
+++ b/core/src/main/java/com/graphhopper/routing/weighting/DefaultTurnCostProvider.java
@@ -32,7 +32,6 @@ public class DefaultTurnCostProvider implements TurnCostProvider {
     private final TurnCostStorage turnCostStorage;
     private final int uTurnCostsInt;
     private final double uTurnCosts;
-    private final IntsRef tcFlags = TurnCost.createFlags();
 
     public DefaultTurnCostProvider(FlagEncoder encoder, TurnCostStorage turnCostStorage) {
         this(encoder, turnCostStorage, Weighting.INFINITE_U_TURN_COSTS);
@@ -68,7 +67,7 @@ public class DefaultTurnCostProvider implements TurnCostProvider {
             tCost = turnCostStorage.isUTurnAllowed(nodeVia) ? uTurnCosts : Double.POSITIVE_INFINITY;
         } else {
             if (turnCostEnc != null)
-                tCost = turnCostStorage.get(turnCostEnc, tcFlags, edgeFrom, nodeVia, edgeTo);
+                tCost = turnCostStorage.get(turnCostEnc, TurnCost.createFlags(), edgeFrom, nodeVia, edgeTo);
         }
         return tCost;
     }
diff --git a/core/src/main/java/com/graphhopper/storage/TurnCostStorage.java b/core/src/main/java/com/graphhopper/storage/TurnCostStorage.java
index c90c28075..d2c123801 100644
--- a/core/src/main/java/com/graphhopper/storage/TurnCostStorage.java
+++ b/core/src/main/java/com/graphhopper/storage/TurnCostStorage.java
@@ -198,15 +198,13 @@ public class TurnCostStorage implements Storable<TurnCostStorage> {
      * @return the turn cost of the viaNode when going from "fromEdge" to "toEdge"
      */
     public double get(DecimalEncodedValue turnCostEnc, IntsRef tcFlags, int fromEdge, int viaNode, int toEdge) {
-        // reset is required as we could have a QueryGraph that does not set tcFlags
-        tcFlags.ints[0] = 0;
         return turnCostEnc.getDecimal(false, readFlags(tcFlags, fromEdge, viaNode, toEdge));
     }
 
     /**
      * @return turn cost flags of the specified triple "from edge", "via node" and "to edge"
      */
-    public IntsRef readFlags(IntsRef tcFlags, int fromEdge, int viaNode, int toEdge) {
+    private IntsRef readFlags(IntsRef tcFlags, int fromEdge, int viaNode, int toEdge) {
         if (!EdgeIterator.Edge.isValid(fromEdge) || !EdgeIterator.Edge.isValid(toEdge))
             throw new IllegalArgumentException("from and to edge cannot be NO_EDGE");
         if (viaNode < 0)
diff --git a/core/src/main/java/com/graphhopper/util/GHUtility.java b/core/src/main/java/com/graphhopper/util/GHUtility.java
index 4a69337f1..92eea753e 100644
--- a/core/src/main/java/com/graphhopper/util/GHUtility.java
+++ b/core/src/main/java/com/graphhopper/util/GHUtility.java
@@ -896,4 +896,76 @@ public class GHUtility {
             throw new UnsupportedOperationException("Not supported. Edge is empty.");
         }
     }
+
+    /**
+     * This node access can be used in tests to mock specific iterator behaviour via overloading
+     * certain methods.
+     */
+    public static class DisabledNodeAccess implements NodeAccess {
+
+        @Override
+        public int getTurnCostIndex(int nodeId) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public void setTurnCostIndex(int nodeId, int additionalValue) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public boolean is3D() {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public int getDimension() {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public void ensureNode(int nodeId) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public void setNode(int nodeId, double lat, double lon) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public void setNode(int nodeId, double lat, double lon, double ele) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public double getLatitude(int nodeId) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public double getLat(int nodeId) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public double getLongitude(int nodeId) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public double getLon(int nodeId) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public double getElevation(int nodeId) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+
+        @Override
+        public double getEle(int nodeId) {
+            throw new UnsupportedOperationException("Not supported.");
+        }
+    }
 }


Test patch:
diff --git a/client-hc/src/test/java/com/graphhopper/api/GraphHopperMatrixIT.java b/client-hc/src/test/java/com/graphhopper/api/GraphHopperMatrixIT.java
index c71bd32ab..95c643591 100644
--- a/client-hc/src/test/java/com/graphhopper/api/GraphHopperMatrixIT.java
+++ b/client-hc/src/test/java/com/graphhopper/api/GraphHopperMatrixIT.java
@@ -49,7 +49,7 @@ public class GraphHopperMatrixIT {
         }
 
         // ... only weight:
-        assertEquals(1840, res.getWeight(1, 2), 10);
+        assertEquals(1930, res.getWeight(1, 2), 10);
 
         req = AbstractGHMatrixWebTester.createRequest();
         req.addOutArray("weights");
@@ -57,7 +57,7 @@ public class GraphHopperMatrixIT {
         res = ghMatrix.route(req);
 
         assertEquals(9800, res.getDistance(1, 2), 50);
-        assertEquals(1840, res.getWeight(1, 2), 10);
+        assertEquals(1930, res.getWeight(1, 2), 10);
     }
 
     @Test
diff --git a/client-hc/src/test/java/com/graphhopper/api/GraphHopperWebIT.java b/client-hc/src/test/java/com/graphhopper/api/GraphHopperWebIT.java
index 2de37ee5f..bc70820c0 100644
--- a/client-hc/src/test/java/com/graphhopper/api/GraphHopperWebIT.java
+++ b/client-hc/src/test/java/com/graphhopper/api/GraphHopperWebIT.java
@@ -308,7 +308,7 @@ public class GraphHopperWebIT {
         }
 
         // ... only weight:
-        assertEquals(1840, res.getWeight(1, 2), 5);
+        assertEquals(1930, res.getWeight(1, 2), 10);
 
         req = AbstractGHMatrixWebTester.createRequest();
         req.addOutArray("weights");
@@ -316,7 +316,7 @@ public class GraphHopperWebIT {
         res = ghMatrix.route(req);
 
         assertEquals(9834, res.getDistance(1, 2), 20);
-        assertEquals(1840, res.getWeight(1, 2), 10);
+        assertEquals(1930, res.getWeight(1, 2), 10);
     }
 
     @Test
diff --git a/core/src/main/java/com/graphhopper/routing/weighting/FastestWeighting.java b/core/src/main/java/com/graphhopper/routing/weighting/FastestWeighting.java
index 1e59be64b..4c94ef41e 100644
--- a/core/src/main/java/com/graphhopper/routing/weighting/FastestWeighting.java
+++ b/core/src/main/java/com/graphhopper/routing/weighting/FastestWeighting.java
@@ -45,8 +45,8 @@ public class FastestWeighting extends AbstractWeighting {
     private final long headingPenaltyMillis;
     private final double maxSpeed;
     private final EnumEncodedValue<RoadAccess> roadAccessEnc;
-    // this factor puts a penalty on roads with a "destination"-only access, see #733
-    private final double destinationPenalty;
+    // this factor puts a penalty on roads with a "destination"-only or private access, see #733 and #1936
+    private final double destinationPenalty, privatePenalty;
 
     public FastestWeighting(FlagEncoder encoder) {
         this(encoder, new HintsMap(0));
@@ -70,9 +70,11 @@ public class FastestWeighting extends AbstractWeighting {
             throw new IllegalArgumentException("road_access is not available but expected for FastestWeighting");
 
         // ensure that we do not need to change getMinWeight, i.e. road_access_factor >= 1
-        double defaultFactor = encoder.getTransportationMode() == TransportationMode.MOTOR_VEHICLE ? 10 : 1;
-        destinationPenalty = checkBounds("road_access_destination_factor", map.getDouble("road_access_destination_factor", defaultFactor), 1, 10);
-        roadAccessEnc = destinationPenalty > 1 ? encoder.getEnumEncodedValue(RoadAccess.KEY, RoadAccess.class) : null;
+        double defaultDestinationFactor = encoder.getTransportationMode() == TransportationMode.MOTOR_VEHICLE ? 10 : 1;
+        destinationPenalty = checkBounds("road_access_destination_factor", map.getDouble("road_access_destination_factor", defaultDestinationFactor), 1, 10);
+        double defaultPrivateFactor = encoder.getTransportationMode() == TransportationMode.MOTOR_VEHICLE ? 10 : 1.2;
+        privatePenalty = checkBounds("road_access_private_factor", map.getDouble("road_access_private_factor", defaultPrivateFactor), 1, 10);
+        roadAccessEnc = destinationPenalty > 1 || privatePenalty > 1 ? encoder.getEnumEncodedValue(RoadAccess.KEY, RoadAccess.class) : null;
     }
 
     @Override
@@ -92,6 +94,8 @@ public class FastestWeighting extends AbstractWeighting {
             RoadAccess access = edgeState.get(roadAccessEnc);
             if (access == RoadAccess.DESTINATION)
                 time *= destinationPenalty;
+            else if (access == RoadAccess.PRIVATE)
+                time *= privatePenalty;
         }
         // add direction penalties at start/stop/via points
         boolean unfavoredEdge = edgeState.get(EdgeIteratorState.UNFAVORED_EDGE);
diff --git a/core/src/test/java/com/graphhopper/routing/BidirPathExtractorTest.java b/core/src/test/java/com/graphhopper/routing/BidirPathExtractorTest.java
index 773b85a7d..04bf93d41 100644
--- a/core/src/test/java/com/graphhopper/routing/BidirPathExtractorTest.java
+++ b/core/src/test/java/com/graphhopper/routing/BidirPathExtractorTest.java
@@ -36,7 +36,7 @@ import static org.junit.Assert.assertEquals;
  * @author easbar
  */
 public class BidirPathExtractorTest {
-    private FlagEncoder carEncoder = new CarFlagEncoder(5, 5, 10);
+    private FlagEncoder carEncoder = new CarFlagEncoder(5, 5, 10, true);
     private final EncodingManager encodingManager = EncodingManager.create(carEncoder);
 
     Graph createGraph() {
diff --git a/core/src/test/java/com/graphhopper/routing/CHQueryWithTurnCostsTest.java b/core/src/test/java/com/graphhopper/routing/CHQueryWithTurnCostsTest.java
index bc456d80d..5d3450c32 100644
--- a/core/src/test/java/com/graphhopper/routing/CHQueryWithTurnCostsTest.java
+++ b/core/src/test/java/com/graphhopper/routing/CHQueryWithTurnCostsTest.java
@@ -49,7 +49,7 @@ import static org.junit.Assert.assertFalse;
 @RunWith(Parameterized.class)
 public class CHQueryWithTurnCostsTest {
     private final int maxCost = 10;
-    private final FlagEncoder encoder = new MotorcycleFlagEncoder(5, 5, maxCost);
+    private final FlagEncoder encoder = new MotorcycleFlagEncoder(5, 5, maxCost, true);
     private final EncodingManager encodingManager = EncodingManager.create(encoder);
     private final Weighting weighting;
     private final GraphHopperStorage graph;
diff --git a/core/src/test/java/com/graphhopper/routing/DirectedBidirectionalDijkstraTest.java b/core/src/test/java/com/graphhopper/routing/DirectedBidirectionalDijkstraTest.java
index b40748f81..45033c0b4 100644
--- a/core/src/test/java/com/graphhopper/routing/DirectedBidirectionalDijkstraTest.java
+++ b/core/src/test/java/com/graphhopper/routing/DirectedBidirectionalDijkstraTest.java
@@ -50,7 +50,7 @@ public class DirectedBidirectionalDijkstraTest {
     public void setup() {
         dir = new RAMDirectory();
         maxTurnCosts = 10;
-        encoder = new CarFlagEncoder(5, 5, maxTurnCosts);
+        encoder = new CarFlagEncoder(5, 5, maxTurnCosts, true);
         encodingManager = EncodingManager.create(encoder);
         graph = new GraphHopperStorage(dir, encodingManager, false, true).create(1000);
         turnCostStorage = graph.getTurnCostStorage();
diff --git a/core/src/test/java/com/graphhopper/routing/EdgeBasedRoutingAlgorithmTest.java b/core/src/test/java/com/graphhopper/routing/EdgeBasedRoutingAlgorithmTest.java
index 294fd2624..7af4c9c88 100644
--- a/core/src/test/java/com/graphhopper/routing/EdgeBasedRoutingAlgorithmTest.java
+++ b/core/src/test/java/com/graphhopper/routing/EdgeBasedRoutingAlgorithmTest.java
@@ -89,11 +89,7 @@ public class EdgeBasedRoutingAlgorithmTest {
     }
 
     private EncodingManager createEncodingManager(boolean restrictedOnly) {
-        if (restrictedOnly)
-            carEncoder = new CarFlagEncoder(5, 5, 1);
-        else
-            // allow for basic costs too
-            carEncoder = new CarFlagEncoder(5, 5, 3);
+        carEncoder = new CarFlagEncoder(5, 5, restrictedOnly ? 1 : 3, true);
         return EncodingManager.create(carEncoder);
     }
 
diff --git a/core/src/test/java/com/graphhopper/routing/RandomCHRoutingTest.java b/core/src/test/java/com/graphhopper/routing/RandomCHRoutingTest.java
index 26c2c9a2a..6fd4c0d9d 100644
--- a/core/src/test/java/com/graphhopper/routing/RandomCHRoutingTest.java
+++ b/core/src/test/java/com/graphhopper/routing/RandomCHRoutingTest.java
@@ -59,7 +59,7 @@ public class RandomCHRoutingTest {
     @Before
     public void init() {
         dir = new RAMDirectory();
-        encoder = new CarFlagEncoder(5, 5, maxTurnCosts);
+        encoder = new CarFlagEncoder(5, 5, maxTurnCosts, true);
         encodingManager = EncodingManager.create(encoder);
         graph = new GraphBuilder(encodingManager)
                 .setCHProfileStrings("car|fastest|" + (traversalMode.isEdgeBased() ? "edge" : "node") + "|" + uTurnCosts)
diff --git a/core/src/test/java/com/graphhopper/routing/RoutingAlgorithmIT.java b/core/src/test/java/com/graphhopper/routing/RoutingAlgorithmIT.java
index 46f1b097f..bd78dbda8 100644
--- a/core/src/test/java/com/graphhopper/routing/RoutingAlgorithmIT.java
+++ b/core/src/test/java/com/graphhopper/routing/RoutingAlgorithmIT.java
@@ -71,21 +71,21 @@ public class RoutingAlgorithmIT {
                 .setVehicle(hints.getVehicle()).setWeighting(hints.getWeighting());
 
         AlgorithmOptions defaultOpts = AlgorithmOptions.start(new AlgorithmOptions("", weighting, tMode)).hints(defaultHints).build();
-        List<AlgoHelperEntry> prepare = new ArrayList<>();
-        prepare.add(new AlgoHelperEntry(ghStorage, AlgorithmOptions.start(defaultOpts).algorithm(ASTAR).build(), idx, "astar|beeline|" + addStr + weighting));
+        List<AlgoHelperEntry> algos = new ArrayList<>();
+        algos.add(new AlgoHelperEntry(ghStorage, AlgorithmOptions.start(defaultOpts).algorithm(ASTAR).build(), idx, "astar|beeline|" + addStr + weighting));
         // later: include dijkstraOneToMany
-        prepare.add(new AlgoHelperEntry(ghStorage, AlgorithmOptions.start(defaultOpts).algorithm(DIJKSTRA).build(), idx, "dijkstra|" + addStr + weighting));
+        algos.add(new AlgoHelperEntry(ghStorage, AlgorithmOptions.start(defaultOpts).algorithm(DIJKSTRA).build(), idx, "dijkstra|" + addStr + weighting));
 
         AlgorithmOptions astarbiOpts = AlgorithmOptions.start(defaultOpts).algorithm(ASTAR_BI).build();
         astarbiOpts.getHints().put(ASTAR_BI + ".approximation", "BeelineSimplification");
         AlgorithmOptions dijkstrabiOpts = AlgorithmOptions.start(defaultOpts).algorithm(DIJKSTRA_BI).build();
-        prepare.add(new AlgoHelperEntry(ghStorage, astarbiOpts, idx, "astarbi|beeline|" + addStr + weighting));
-        prepare.add(new AlgoHelperEntry(ghStorage, dijkstrabiOpts, idx, "dijkstrabi|" + addStr + weighting));
+        algos.add(new AlgoHelperEntry(ghStorage, astarbiOpts, idx, "astarbi|beeline|" + addStr + weighting));
+        algos.add(new AlgoHelperEntry(ghStorage, dijkstrabiOpts, idx, "dijkstrabi|" + addStr + weighting));
 
         // add additional preparations if CH and LM preparation are enabled
         if (hopper.getLMPreparationHandler().isEnabled()) {
             final HintsMap lmHints = new HintsMap(defaultHints).put(Parameters.Landmark.DISABLE, false);
-            prepare.add(new AlgoHelperEntry(ghStorage, AlgorithmOptions.start(astarbiOpts).hints(lmHints).build(), idx, "astarbi|landmarks|" + weighting) {
+            algos.add(new AlgoHelperEntry(ghStorage, AlgorithmOptions.start(astarbiOpts).hints(lmHints).build(), idx, "astarbi|landmarks|" + weighting) {
                 @Override
                 public RoutingAlgorithmFactory createRoutingFactory() {
                     return hopper.getAlgorithmFactory(lmHints);
@@ -98,16 +98,16 @@ public class RoutingAlgorithmIT {
             chHints.put(Parameters.CH.DISABLE, false);
             chHints.put(Parameters.Routing.EDGE_BASED, tMode.isEdgeBased());
             CHProfile pickedProfile = CHProfileSelector.select(hopper.getCHPreparationHandler().getCHProfiles(), chHints);
-            prepare.add(new AlgoHelperEntry(ghStorage.getCHGraph(pickedProfile),
-                    AlgorithmOptions.start(dijkstrabiOpts).hints(chHints).build(), idx, "dijkstrabi|ch|prepare|" + hints.getWeighting()) {
+            algos.add(new AlgoHelperEntry(ghStorage.getCHGraph(pickedProfile),
+                    AlgorithmOptions.start(dijkstrabiOpts).hints(chHints).build(), idx, "dijkstrabi|ch|algos|" + hints.getWeighting()) {
                 @Override
                 public RoutingAlgorithmFactory createRoutingFactory() {
                     return hopper.getAlgorithmFactory(chHints);
                 }
             });
 
-            prepare.add(new AlgoHelperEntry(ghStorage.getCHGraph(pickedProfile),
-                    AlgorithmOptions.start(astarbiOpts).hints(chHints).build(), idx, "astarbi|ch|prepare|" + hints.getWeighting()) {
+            algos.add(new AlgoHelperEntry(ghStorage.getCHGraph(pickedProfile),
+                    AlgorithmOptions.start(astarbiOpts).hints(chHints).build(), idx, "astarbi|ch|algos|" + hints.getWeighting()) {
                 @Override
                 public RoutingAlgorithmFactory createRoutingFactory() {
                     return hopper.getAlgorithmFactory(chHints);
@@ -115,7 +115,7 @@ public class RoutingAlgorithmIT {
             });
         }
 
-        return prepare;
+        return algos;
     }
 
     @Test
diff --git a/core/src/test/java/com/graphhopper/routing/ch/CHTurnCostTest.java b/core/src/test/java/com/graphhopper/routing/ch/CHTurnCostTest.java
index 21f7ccf88..4dd9561ff 100644
--- a/core/src/test/java/com/graphhopper/routing/ch/CHTurnCostTest.java
+++ b/core/src/test/java/com/graphhopper/routing/ch/CHTurnCostTest.java
@@ -73,7 +73,7 @@ public class CHTurnCostTest {
     public void init() {
         // its important to use @Before when using Repeat Rule!
         maxCost = 10;
-        encoder = new CarFlagEncoder(5, 5, maxCost);
+        encoder = new CarFlagEncoder(5, 5, maxCost, true);
         encodingManager = EncodingManager.create(encoder);
         graph = new GraphBuilder(encodingManager).build();
         turnCostStorage = graph.getTurnCostStorage();
diff --git a/core/src/test/java/com/graphhopper/routing/ch/EdgeBasedNodeContractorTest.java b/core/src/test/java/com/graphhopper/routing/ch/EdgeBasedNodeContractorTest.java
index 715bfb682..f5268d6bf 100644
--- a/core/src/test/java/com/graphhopper/routing/ch/EdgeBasedNodeContractorTest.java
+++ b/core/src/test/java/com/graphhopper/routing/ch/EdgeBasedNodeContractorTest.java
@@ -62,7 +62,7 @@ public class EdgeBasedNodeContractorTest {
     }
 
     private void initialize() {
-        encoder = new CarFlagEncoder(5, 5, maxCost);
+        encoder = new CarFlagEncoder(5, 5, maxCost, true);
         EncodingManager encodingManager = EncodingManager.create(encoder);
         graph = new GraphBuilder(encodingManager)
                 .setCHProfileStrings(
diff --git a/core/src/test/java/com/graphhopper/routing/ch/EdgeBasedWitnessPathSearcherTest.java b/core/src/test/java/com/graphhopper/routing/ch/EdgeBasedWitnessPathSearcherTest.java
index 1332a3a2c..0d89894ce 100644
--- a/core/src/test/java/com/graphhopper/routing/ch/EdgeBasedWitnessPathSearcherTest.java
+++ b/core/src/test/java/com/graphhopper/routing/ch/EdgeBasedWitnessPathSearcherTest.java
@@ -40,7 +40,7 @@ public class EdgeBasedWitnessPathSearcherTest {
 
     @Before
     public void setup() {
-        CarFlagEncoder encoder = new CarFlagEncoder(5, 5, 10);
+        CarFlagEncoder encoder = new CarFlagEncoder(5, 5, 10, true);
         EncodingManager encodingManager = EncodingManager.create(encoder);
         graph = new GraphBuilder(encodingManager)
                 .setCHProfileStrings("car|shortest|edge")
diff --git a/core/src/test/java/com/graphhopper/routing/ch/Path4CHTest.java b/core/src/test/java/com/graphhopper/routing/ch/Path4CHTest.java
index 9044121b7..810f9b3cc 100644
--- a/core/src/test/java/com/graphhopper/routing/ch/Path4CHTest.java
+++ b/core/src/test/java/com/graphhopper/routing/ch/Path4CHTest.java
@@ -25,7 +25,7 @@ public class Path4CHTest {
 
     @Before
     public void init() {
-        encoder = new MotorcycleFlagEncoder(5, 5, maxTurnCosts);
+        encoder = new MotorcycleFlagEncoder(5, 5, maxTurnCosts, true);
         EncodingManager em = EncodingManager.create(encoder);
         graph = new GraphBuilder(em)
                 .setCHProfileStrings("motorcycle|fastest|edge")
diff --git a/core/src/test/java/com/graphhopper/routing/ch/PrepareContractionHierarchiesTest.java b/core/src/test/java/com/graphhopper/routing/ch/PrepareContractionHierarchiesTest.java
index 5340162a9..9a66d0978 100644
--- a/core/src/test/java/com/graphhopper/routing/ch/PrepareContractionHierarchiesTest.java
+++ b/core/src/test/java/com/graphhopper/routing/ch/PrepareContractionHierarchiesTest.java
@@ -44,7 +44,7 @@ import static org.junit.Assert.*;
  * @author Peter Karich
  */
 public class PrepareContractionHierarchiesTest {
-    private final CarFlagEncoder carEncoder = new CarFlagEncoder("speed_two_directions=true");
+    private final CarFlagEncoder carEncoder = new CarFlagEncoder(new PMap("speed_two_directions=true"));
     private final EncodingManager encodingManager = EncodingManager.create(carEncoder);
     private final Weighting weighting = new ShortestWeighting(carEncoder);
     private final CHProfile chProfile = CHProfile.nodeBased(weighting);
diff --git a/core/src/test/java/com/graphhopper/routing/lm/LMApproximatorTest.java b/core/src/test/java/com/graphhopper/routing/lm/LMApproximatorTest.java
index d53caa687..79081366c 100644
--- a/core/src/test/java/com/graphhopper/routing/lm/LMApproximatorTest.java
+++ b/core/src/test/java/com/graphhopper/routing/lm/LMApproximatorTest.java
@@ -60,7 +60,7 @@ public class LMApproximatorTest {
 
     private void run(long seed) {
         Directory dir = new RAMDirectory();
-        CarFlagEncoder encoder = new CarFlagEncoder(5, 5, 1);
+        CarFlagEncoder encoder = new CarFlagEncoder(5, 5, 1, true);
         EncodingManager encodingManager = EncodingManager.create(encoder);
         GraphHopperStorage graph = new GraphBuilder(encodingManager).setDir(dir).withTurnCosts(true).create();
 
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 2ba84905c..fee97411e 100644
--- a/core/src/test/java/com/graphhopper/routing/profiles/DecimalEncodedValueTest.java
+++ b/core/src/test/java/com/graphhopper/routing/profiles/DecimalEncodedValueTest.java
@@ -22,7 +22,7 @@ public class DecimalEncodedValueTest {
 
     @Test
     public void testMaxValue() {
-        CarFlagEncoder carEncoder = new CarFlagEncoder(10, 0.5, 0);
+        CarFlagEncoder carEncoder = new CarFlagEncoder(10, 0.5, 0, true);
         EncodingManager em = EncodingManager.create(carEncoder);
         DecimalEncodedValue carAverageSpeedEnc = em.getDecimalEncodedValue(EncodingManager.getKey(carEncoder, "average_speed"));
 
diff --git a/core/src/test/java/com/graphhopper/routing/querygraph/QueryGraphTest.java b/core/src/test/java/com/graphhopper/routing/querygraph/QueryGraphTest.java
index ad067fbc1..b7624c6e1 100644
--- a/core/src/test/java/com/graphhopper/routing/querygraph/QueryGraphTest.java
+++ b/core/src/test/java/com/graphhopper/routing/querygraph/QueryGraphTest.java
@@ -491,7 +491,7 @@ public class QueryGraphTest {
 
     @Test
     public void testTurnCostsProperlyPropagated_Issue282() {
-        FlagEncoder encoder = new CarFlagEncoder(5, 5, 15);
+        FlagEncoder encoder = new CarFlagEncoder(5, 5, 15, true);
         EncodingManager em = EncodingManager.create(encoder);
         GraphHopperStorage graphWithTurnCosts = new GraphHopperStorage(new RAMDirectory(), em, false, true).
                 create(100);
diff --git a/core/src/test/java/com/graphhopper/routing/util/AbstractFlagEncoderTest.java b/core/src/test/java/com/graphhopper/routing/util/AbstractFlagEncoderTest.java
index a8d01329e..2c5698bc9 100644
--- a/core/src/test/java/com/graphhopper/routing/util/AbstractFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/AbstractFlagEncoderTest.java
@@ -27,7 +27,7 @@ import static org.junit.Assert.assertEquals;
 public class AbstractFlagEncoderTest {
     @Test
     public void testAcceptsCar() {
-        CarFlagEncoder encoder = new CarFlagEncoder(5, 5, 0);
+        CarFlagEncoder encoder = new CarFlagEncoder(5, 5, 0, true);
         assertEquals(40, encoder.parseSpeed("40 km/h"), 1e-3);
         assertEquals(40, encoder.parseSpeed("40km/h"), 1e-3);
         assertEquals(40, encoder.parseSpeed("40kmh"), 1e-3);
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 e7ab9c5a8..573ddcd38 100644
--- a/core/src/test/java/com/graphhopper/routing/util/CarFlagEncoderTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/CarFlagEncoderTest.java
@@ -215,7 +215,6 @@ public class CarFlagEncoderTest {
         way.clearTags();
     }
 
-
     @Test
     public void testDestinationTag() {
         IntsRef relFlags = em.createRelationFlags();
@@ -231,12 +230,51 @@ public class CarFlagEncoderTest {
         assertEquals(60, weighting.calcEdgeWeight(GHUtility.createMockedEdgeIteratorState(1000, edgeFlags), false), 0.1);
         assertEquals(200, bikeWeighting.calcEdgeWeight(GHUtility.createMockedEdgeIteratorState(1000, edgeFlags), false), 0.1);
 
+        // no change for bike!
+        way.setTag("motor_vehicle", "destination");
+        edgeFlags = em.handleWayTags(way, acceptWay, relFlags);
+        assertEquals(600, weighting.calcEdgeWeight(GHUtility.createMockedEdgeIteratorState(1000, edgeFlags), false), 0.1);
+        assertEquals(200, bikeWeighting.calcEdgeWeight(GHUtility.createMockedEdgeIteratorState(1000, edgeFlags), false), 0.1);
+
+        way = new ReaderWay(1);
+        way.setTag("highway", "secondary");
         way.setTag("vehicle", "destination");
         edgeFlags = em.handleWayTags(way, acceptWay, relFlags);
         assertEquals(600, weighting.calcEdgeWeight(GHUtility.createMockedEdgeIteratorState(1000, edgeFlags), false), 0.1);
         assertEquals(200, bikeWeighting.calcEdgeWeight(GHUtility.createMockedEdgeIteratorState(1000, edgeFlags), false), 0.1);
     }
 
+    @Test
+    public void testPrivateTag() {
+        // allow private access
+        FlagEncoder carEncoder = new CarFlagEncoder(5, 5, 0, false);
+        FlagEncoder bikeEncoder = new BikeFlagEncoder(4, 2, 0, false);
+        EncodingManager em = new EncodingManager.Builder().add(carEncoder).add(bikeEncoder).build();
+
+        FastestWeighting weighting = new FastestWeighting(carEncoder);
+        FastestWeighting bikeWeighting = new FastestWeighting(bikeEncoder);
+
+        ReaderWay way = new ReaderWay(1);
+        way.setTag("highway", "secondary");
+
+        EncodingManager.AcceptWay acceptWay = new EncodingManager.AcceptWay();
+        assertTrue(em.acceptWay(way, acceptWay));
+        IntsRef edgeFlags = em.handleWayTags(way, acceptWay, em.createRelationFlags());
+
+        assertEquals(60, weighting.calcEdgeWeight(GHUtility.createMockedEdgeIteratorState(1000, edgeFlags), false), 0.1);
+        assertEquals(200, bikeWeighting.calcEdgeWeight(GHUtility.createMockedEdgeIteratorState(1000, edgeFlags), false), 0.1);
+
+        way.setTag("highway", "secondary");
+        way.setTag("access", "private");
+        acceptWay = new EncodingManager.AcceptWay();
+        assertTrue(em.acceptWay(way, acceptWay));
+        edgeFlags = em.handleWayTags(way, acceptWay, em.createRelationFlags());
+
+        assertEquals(600, weighting.calcEdgeWeight(GHUtility.createMockedEdgeIteratorState(1000, edgeFlags), false), 0.1);
+        // private should influence bike only slightly
+        assertEquals(240, bikeWeighting.calcEdgeWeight(GHUtility.createMockedEdgeIteratorState(1000, edgeFlags), false), 0.1);
+    }
+
     @Test
     public void testSetAccess() {
         IntsRef edgeFlags = em.createEdgeFlags();
@@ -543,7 +581,7 @@ public class CarFlagEncoderTest {
 
     @Test
     public void testMaxValue() {
-        CarFlagEncoder instance = new CarFlagEncoder(10, 0.5, 0);
+        CarFlagEncoder instance = new CarFlagEncoder(10, 0.5, 0, true);
         EncodingManager em = EncodingManager.create(instance);
         DecimalEncodedValue avSpeedEnc = em.getDecimalEncodedValue(EncodingManager.getKey(instance, "average_speed"));
         ReaderWay way = new ReaderWay(1);
@@ -566,7 +604,7 @@ public class CarFlagEncoderTest {
 
     @Test
     public void testRegisterOnlyOnceAllowed() {
-        CarFlagEncoder instance = new CarFlagEncoder(10, 0.5, 0);
+        CarFlagEncoder instance = new CarFlagEncoder(10, 0.5, 0, true);
         EncodingManager tmpEM = EncodingManager.create(instance);
         try {
             tmpEM = EncodingManager.create(instance);
@@ -612,7 +650,7 @@ public class CarFlagEncoderTest {
         way.setTag("route", "ferry");
         way.setTag("estimated_distance", 257);
 
-        CarFlagEncoder lowFactorCar = new CarFlagEncoder(10, 1, 0);
+        CarFlagEncoder lowFactorCar = new CarFlagEncoder(10, 1, 0, true);
         List<EncodedValue> list = new ArrayList<>();
         lowFactorCar.setEncodedValueLookup(em);
         lowFactorCar.createEncodedValues(list, "car", 0);
diff --git a/core/src/test/java/com/graphhopper/routing/util/EncodedValueOldTest.java b/core/src/test/java/com/graphhopper/routing/util/EncodedValueOldTest.java
deleted file mode 100644
index 4a479bc7f..000000000
--- a/core/src/test/java/com/graphhopper/routing/util/EncodedValueOldTest.java
+++ /dev/null
@@ -1,41 +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;
-
-import com.graphhopper.storage.IntsRef;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * @author Peter Karich
- */
-public class EncodedValueOldTest {
-    @Test
-    public void testSetValue() {
-        EncodedValueOld instance = new EncodedValueOld("test", 6, 4, 1, 5, 10);
-        assertEquals(10, instance.getValue(instance.setValue(0, 10)));
-
-        instance = new EncodedValueOld("test", 0, 4, 1, 5, 10);
-        assertEquals(10, instance.getValue(instance.setValue(0, 10)));
-
-        instance = new EncodedValueOld("test", 0, 4, 1, 5, 10);
-        long flags = instance.setDefaultValue(0);
-        assertEquals(5, instance.getValue(flags));
-    }
-}
diff --git a/core/src/test/java/com/graphhopper/routing/util/NameSimilarityEdgeFilterTest.java b/core/src/test/java/com/graphhopper/routing/util/NameSimilarityEdgeFilterTest.java
index 4171b36e1..e344bd94d 100644
--- a/core/src/test/java/com/graphhopper/routing/util/NameSimilarityEdgeFilterTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/NameSimilarityEdgeFilterTest.java
@@ -17,8 +17,17 @@
  */
 package com.graphhopper.routing.util;
 
+import com.graphhopper.routing.querygraph.QueryGraph;
+import com.graphhopper.storage.Graph;
+import com.graphhopper.storage.GraphBuilder;
+import com.graphhopper.storage.NodeAccess;
+import com.graphhopper.storage.index.LocationIndex;
+import com.graphhopper.util.CHEdgeIterator;
+import com.graphhopper.util.EdgeIterator;
 import com.graphhopper.util.EdgeIteratorState;
 import com.graphhopper.util.GHUtility;
+import com.graphhopper.util.shapes.GHPoint;
+import org.junit.Before;
 import org.junit.Test;
 
 import static junit.framework.TestCase.assertFalse;
@@ -30,6 +39,8 @@ import static org.junit.Assert.assertTrue;
  */
 public class NameSimilarityEdgeFilterTest {
 
+    private GHPoint basePoint = new GHPoint(49.4652132,11.1435159);
+
     @Test
     public void testAccept() {
         EdgeFilter edgeFilter = createNameSimilarityEdgeFilter("Laufamholzstraße 154 Nürnberg");
@@ -77,6 +88,34 @@ public class NameSimilarityEdgeFilterTest {
         assertTrue(edgeFilter.accept(edge));
     }
 
+    @Test
+    public void testDistanceFiltering() {
+        CarFlagEncoder encoder = new CarFlagEncoder();
+        Graph g = new GraphBuilder(EncodingManager.create(encoder)).create();
+        NodeAccess na = g.getNodeAccess();
+
+        GHPoint pointFarAway = new GHPoint(49.458629, 11.146124);
+        GHPoint point25mAway = new GHPoint(49.464871, 11.143575);
+        GHPoint point200mAway = new GHPoint(49.464598, 11.149039);
+
+        int farAwayId = 0;
+        int nodeId50 = 1;
+        int nodeID200 = 2;
+
+        na.setNode(farAwayId, pointFarAway.lat, pointFarAway.lon);
+        na.setNode(nodeId50, point25mAway.lat, point25mAway.lon);
+        na.setNode(nodeID200, point200mAway.lat, point200mAway.lon);
+
+        // Check that it matches a street 50m away
+        assertTrue(createNameSimilarityEdgeFilter(na, "Wentworth Street").
+                accept(createTestEdgeIterator("Wentworth Street", nodeId50, farAwayId)));
+
+        // Check that it doesn't match streets 200m away
+        assertFalse(createNameSimilarityEdgeFilter(na, "Wentworth Street").
+                accept(createTestEdgeIterator("Wentworth Street", nodeID200, farAwayId)));
+
+    }
+
     /**
      * With Nominatim you should not use the "placename" for best results, otherwise the length difference becomes too big
      */
@@ -192,22 +231,51 @@ public class NameSimilarityEdgeFilterTest {
 //        assertTrue(edgeFilter.accept(edge));
     }
 
+    /**
+     * Create a NameSimilarityEdgeFilter that uses the same coordinates for all nodes
+     * so distance is not used when matching
+     */
     private NameSimilarityEdgeFilter createNameSimilarityEdgeFilter(String pointHint) {
+        return createNameSimilarityEdgeFilter(new GHUtility.DisabledNodeAccess() {
+            @Override
+            public double getLatitude(int nodeId) {
+                return basePoint.lat;
+            }
+            @Override
+            public double getLongitude(int nodeId) {
+                return basePoint.lon;
+            }
+        }, pointHint);
+    }
+
+    private NameSimilarityEdgeFilter createNameSimilarityEdgeFilter(NodeAccess nodeAccess, String pointHint) {
         return new NameSimilarityEdgeFilter(new EdgeFilter() {
             @Override
             public boolean accept(EdgeIteratorState edgeState) {
                 return true;
             }
-        }, pointHint);
+        }, nodeAccess, basePoint, 100, pointHint);
     }
 
-    private EdgeIteratorState createTestEdgeIterator(final String name) {
+    private EdgeIteratorState createTestEdgeIterator(final String name, final int baseNodeId, final int adjNodeId) {
         return new GHUtility.DisabledEdgeIterator() {
-
             @Override
             public String getName() {
                 return name;
             }
+            @Override
+            public int getBaseNode() {
+                return baseNodeId;
+            }
+            @Override
+            public int getAdjNode() {
+                return adjNodeId;
+            }
         };
     }
+
+    private EdgeIteratorState createTestEdgeIterator(final String name) {
+        return createTestEdgeIterator(name, 0, 0);
+    }
+
 }
diff --git a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParserTest.java b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParserTest.java
index 3523c0822..3a0c54a2c 100644
--- a/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParserTest.java
+++ b/core/src/test/java/com/graphhopper/routing/util/parsers/OSMTurnRelationParserTest.java
@@ -22,7 +22,7 @@ public class OSMTurnRelationParserTest {
 
     @Test
     public void testGetRestrictionAsEntries() {
-        CarFlagEncoder encoder = new CarFlagEncoder(5, 5, 1);
+        CarFlagEncoder encoder = new CarFlagEncoder(5, 5, 1, true);
         final Map<Long, Integer> osmNodeToInternal = new HashMap<>();
         final Map<Integer, Long> internalToOSMEdge = new HashMap<>();
 
diff --git a/core/src/test/java/com/graphhopper/routing/weighting/DirectedRoutingTest.java b/core/src/test/java/com/graphhopper/routing/weighting/DirectedRoutingTest.java
index 146a5035a..e241747d6 100644
--- a/core/src/test/java/com/graphhopper/routing/weighting/DirectedRoutingTest.java
+++ b/core/src/test/java/com/graphhopper/routing/weighting/DirectedRoutingTest.java
@@ -100,7 +100,7 @@ public class DirectedRoutingTest {
         dir = new RAMDirectory();
         maxTurnCosts = 10;
         // todonow: make this work with speed_both_directions=true!
-        encoder = new CarFlagEncoder(5, 5, maxTurnCosts);
+        encoder = new CarFlagEncoder(5, 5, maxTurnCosts, true);
         encodingManager = EncodingManager.create(encoder);
         graph = new GraphBuilder(encodingManager).setDir(dir).withTurnCosts(true).build();
         turnCostStorage = graph.getTurnCostStorage();
diff --git a/core/src/test/java/com/graphhopper/routing/weighting/FastestWeightingTest.java b/core/src/test/java/com/graphhopper/routing/weighting/FastestWeightingTest.java
index b85ecd90f..6a6ca2035 100644
--- a/core/src/test/java/com/graphhopper/routing/weighting/FastestWeightingTest.java
+++ b/core/src/test/java/com/graphhopper/routing/weighting/FastestWeightingTest.java
@@ -38,7 +38,7 @@ import static org.junit.Assert.assertEquals;
  * @author Peter Karich
  */
 public class FastestWeightingTest {
-    private final FlagEncoder encoder = new CarFlagEncoder(5, 5, 10);
+    private final FlagEncoder encoder = new CarFlagEncoder(5, 5, 10, true);
     private final EncodingManager encodingManager = EncodingManager.create(encoder);
 
     @Test
diff --git a/core/src/test/java/com/graphhopper/routing/weighting/RandomizedRoutingTest.java b/core/src/test/java/com/graphhopper/routing/weighting/RandomizedRoutingTest.java
index 486cae5d2..1e338ffa5 100644
--- a/core/src/test/java/com/graphhopper/routing/weighting/RandomizedRoutingTest.java
+++ b/core/src/test/java/com/graphhopper/routing/weighting/RandomizedRoutingTest.java
@@ -102,7 +102,7 @@ public class RandomizedRoutingTest {
     @Before
     public void init() {
         dir = new RAMDirectory();
-        encoder = new MotorcycleFlagEncoder(5, 5, 1);
+        encoder = new MotorcycleFlagEncoder(5, 5, 1, true);
         EncodingManager encodingManager = EncodingManager.create(encoder);
         graph = new GraphBuilder(encodingManager)
                 .setCHProfileStrings("motorcycle|fastest|node", "motorcycle|fastest|edge")
diff --git a/core/src/test/java/com/graphhopper/storage/AbstractGraphStorageTester.java b/core/src/test/java/com/graphhopper/storage/AbstractGraphStorageTester.java
index ef84dd562..9ba66143e 100644
--- a/core/src/test/java/com/graphhopper/storage/AbstractGraphStorageTester.java
+++ b/core/src/test/java/com/graphhopper/storage/AbstractGraphStorageTester.java
@@ -89,7 +89,7 @@ public abstract class AbstractGraphStorageTester {
     }
 
     CarFlagEncoder createCarFlagEncoder() {
-        return new CarFlagEncoder(5, 5, 0);
+        return new CarFlagEncoder(5, 5, 0, true);
     }
 
     protected GraphHopperStorage createGHStorage() {
@@ -1136,7 +1136,7 @@ public abstract class AbstractGraphStorageTester {
 
     static class TmpCarFlagEncoder extends CarFlagEncoder {
         public TmpCarFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts) {
-            super(speedBits, speedFactor, maxTurnCosts);
+            super(speedBits, speedFactor, maxTurnCosts, true);
         }
     }
 }
diff --git a/core/src/test/java/com/graphhopper/storage/GraphHopperStorageWithTurnCostsTest.java b/core/src/test/java/com/graphhopper/storage/GraphHopperStorageWithTurnCostsTest.java
index 82df64f5c..22cd8e782 100644
--- a/core/src/test/java/com/graphhopper/storage/GraphHopperStorageWithTurnCostsTest.java
+++ b/core/src/test/java/com/graphhopper/storage/GraphHopperStorageWithTurnCostsTest.java
@@ -33,7 +33,7 @@ import static org.junit.Assert.assertTrue;
 public class GraphHopperStorageWithTurnCostsTest extends GraphHopperStorageTest {
     @Override
     CarFlagEncoder createCarFlagEncoder() {
-        return new CarFlagEncoder(5, 5, 1400);
+        return new CarFlagEncoder(5, 5, 1400, true);
     }
 
     @Override
diff --git a/core/src/test/java/com/graphhopper/storage/ShortcutUnpackerTest.java b/core/src/test/java/com/graphhopper/storage/ShortcutUnpackerTest.java
index 5f08f8193..40ad8b4d8 100644
--- a/core/src/test/java/com/graphhopper/storage/ShortcutUnpackerTest.java
+++ b/core/src/test/java/com/graphhopper/storage/ShortcutUnpackerTest.java
@@ -44,7 +44,7 @@ public class ShortcutUnpackerTest {
     @Before
     public void init() {
         // use motorcycle to be able to set different fwd/bwd speeds
-        encoder = new MotorcycleFlagEncoder(5, 5, 10);
+        encoder = new MotorcycleFlagEncoder(5, 5, 10, true);
         encodingManager = EncodingManager.create(encoder);
         graph = new GraphBuilder(encodingManager)
                 .setCHProfileStrings("motorcycle|fastest|" + (edgeBased ? "edge" : "node"))
diff --git a/core/src/test/java/com/graphhopper/storage/TurnCostStorageTest.java b/core/src/test/java/com/graphhopper/storage/TurnCostStorageTest.java
index e7ea7963d..894ad3dfa 100644
--- a/core/src/test/java/com/graphhopper/storage/TurnCostStorageTest.java
+++ b/core/src/test/java/com/graphhopper/storage/TurnCostStorageTest.java
@@ -36,8 +36,8 @@ public class TurnCostStorageTest {
 
     @Before
     public void setup() {
-        FlagEncoder carEncoder = new CarFlagEncoder(5, 5, 3);
-        FlagEncoder bikeEncoder = new BikeFlagEncoder(5, 5, 3);
+        FlagEncoder carEncoder = new CarFlagEncoder(5, 5, 3, true);
+        FlagEncoder bikeEncoder = new BikeFlagEncoder(5, 5, 3, true);
         manager = EncodingManager.create(carEncoder, bikeEncoder);
     }
 
diff --git a/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java b/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java
index 3f124aeac..e12bd7182 100644
--- a/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java
+++ b/reader-osm/src/test/java/com/graphhopper/reader/osm/OSMReaderTest.java
@@ -519,28 +519,28 @@ public class OSMReaderTest {
         // (4-3)->(3-8) no_right_turn = (4-3)->(3-8) restricted
         IntsRef tcFlags = TurnCost.createFlags();
         DecimalEncodedValue carTCEnc = hopper.getEncodingManager().getDecimalEncodedValue(TurnCost.key("car"));
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_8)) > 0);
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_3, n3, edge3_8)) > 0);
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_4)) == 0);
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_2)) == 0);
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_4)) == 0);
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_3, n3, edge3_2)) == 0);
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge8_3, n3, edge3_2)) == 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge2_3, n3, edge3_8) > 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge4_3, n3, edge3_8) > 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge2_3, n3, edge3_4) == 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge2_3, n3, edge3_2) == 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge2_3, n3, edge3_4) == 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge4_3, n3, edge3_2) == 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge8_3, n3, edge3_2) == 0);
 
         // u-turn restriction for (6-1)->(1-6) but not for (1-6)->(6-1)
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge1_6, n1, edge1_6)) > 0);
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge1_6, n6, edge1_6)) == 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge1_6, n1, edge1_6) > 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge1_6, n6, edge1_6) == 0);
 
         int edge4_5 = GHUtility.getEdge(graph, n4, n5).getEdge();
         int edge5_6 = GHUtility.getEdge(graph, n5, n6).getEdge();
         int edge5_1 = GHUtility.getEdge(graph, n5, n1).getEdge();
 
         // (4-5)->(5-1) right_turn_only = (4-5)->(5-6) restricted
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_5, n5, edge5_6)) == 0);
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_5, n5, edge5_1)) > 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge4_5, n5, edge5_6) == 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge4_5, n5, edge5_1) > 0);
 
         DecimalEncodedValue bikeTCEnc = hopper.getEncodingManager().getDecimalEncodedValue(TurnCost.key("bike"));
-        assertTrue(bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_5, n5, edge5_6)) == 0);
+        assertTrue(tcStorage.get(bikeTCEnc, tcFlags, edge4_5, n5, edge5_6) == 0);
 
         int n10 = AbstractGraphStorageTester.getIdOf(graph, 40, 10);
         int n11 = AbstractGraphStorageTester.getIdOf(graph, 40, 11);
@@ -549,10 +549,11 @@ public class OSMReaderTest {
         int edge10_11 = GHUtility.getEdge(graph, n10, n11).getEdge();
         int edge11_14 = GHUtility.getEdge(graph, n11, n14).getEdge();
 
-        assertTrue(tcStorage.readFlags(tcFlags, edge11_14, n11, edge10_11).isEmpty());
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge11_14, n11, edge10_11) == 0);
+        assertTrue(tcStorage.get(bikeTCEnc, tcFlags, edge11_14, n11, edge10_11) == 0);
 
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge10_11, n11, edge11_14)) == 0);
-        assertTrue(bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge10_11, n11, edge11_14)) > 0);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge10_11, n11, edge11_14) == 0);
+        assertTrue(tcStorage.get(bikeTCEnc, tcFlags, edge10_11, n11, edge11_14) > 0);
     }
 
     @Test
@@ -606,23 +607,7 @@ public class OSMReaderTest {
 
     @Test
     public void testEstimatedCenter() {
-        final CarFlagEncoder encoder = new CarFlagEncoder() {
-            private EncodedValueOld objectEncoder;
-
-            @Override
-            public int defineNodeBits(int index, int shift) {
-                shift = super.defineNodeBits(index, shift);
-                objectEncoder = new EncodedValueOld("oEnc", shift, 2, 1, 0, 3, true);
-                return shift + 2;
-            }
-
-            @Override
-            public long handleNodeTags(ReaderNode node) {
-                if (node.hasTag("test", "now"))
-                    return -objectEncoder.setValue(0, 1);
-                return 0;
-            }
-        };
+        final CarFlagEncoder encoder = new CarFlagEncoder();
         EncodingManager manager = EncodingManager.create(encoder);
         GraphHopperStorage ghStorage = newGraph(dir, manager, false, false);
         final Map<Integer, Double> latMap = new HashMap<>();
@@ -651,11 +636,6 @@ public class OSMReaderTest {
             }
         };
 
-        // save some node tags for first node
-        ReaderNode osmNode = new ReaderNode(1, 1.1d, 1.0d);
-        osmNode.setTag("test", "now");
-        osmreader.getNodeFlagsMap().put(1, encoder.handleNodeTags(osmNode));
-
         ReaderWay way = new ReaderWay(1L);
         way.getNodes().add(1);
         way.getNodes().add(2);
@@ -720,14 +700,14 @@ public class OSMReaderTest {
      */
     @Test
     public void testTurnFlagCombination() {
-        CarFlagEncoder car = new CarFlagEncoder(5, 5, 24);
-        CarFlagEncoder truck = new CarFlagEncoder(5, 5, 24) {
+        CarFlagEncoder car = new CarFlagEncoder(5, 5, 24, true);
+        CarFlagEncoder truck = new CarFlagEncoder(5, 5, 24, true) {
             @Override
             public String toString() {
                 return "truck";
             }
         };
-        BikeFlagEncoder bike = new BikeFlagEncoder(4, 2, 24);
+        BikeFlagEncoder bike = new BikeFlagEncoder(4, 2, 24, true);
         EncodingManager manager = new EncodingManager.Builder().add(bike).add(truck).add(car).build();
 
         GraphHopper hopper = new GraphHopperOSM().
@@ -742,22 +722,25 @@ public class OSMReaderTest {
         TurnCostStorage tcStorage = graph.getTurnCostStorage();
 
         IntsRef tcFlags = TurnCost.createFlags();
-        tcStorage.readFlags(tcFlags, GHUtility.getEdge(graph, 1, 0).getEdge(), 0, GHUtility.getEdge(graph, 0, 2).getEdge());
+        int edge1 = GHUtility.getEdge(graph, 1, 0).getEdge();
+        int edge2 = GHUtility.getEdge(graph, 0, 2).getEdge();
         // the 2nd entry provides turn flags for bike only
-        assertTrue(Double.isInfinite(carTCEnc.getDecimal(false, tcFlags)));
-        assertTrue(Double.isInfinite(truckTCEnc.getDecimal(false, tcFlags)));
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcFlags), .1);
+        assertTrue(Double.isInfinite(tcStorage.get(carTCEnc, tcFlags, edge1, 0, edge2)));
+        assertTrue(Double.isInfinite(tcStorage.get(truckTCEnc, tcFlags, edge1, 0, edge2)));
+        assertEquals(0, tcStorage.get(bikeTCEnc, tcFlags, edge1, 0, edge2), .1);
 
-        tcStorage.readFlags(tcFlags, GHUtility.getEdge(graph, 2, 0).getEdge(), 0, GHUtility.getEdge(graph, 0, 3).getEdge());
+        edge1 = GHUtility.getEdge(graph, 2, 0).getEdge();
+        edge2 = GHUtility.getEdge(graph, 0, 3).getEdge();
         // the first entry provides turn flags for car and foot only
-        assertEquals(0, carTCEnc.getDecimal(false, tcFlags), .1);
-        assertEquals(0, truckTCEnc.getDecimal(false, tcFlags), .1);
-        assertTrue(Double.isInfinite(bikeTCEnc.getDecimal(false, tcFlags)));
+        assertEquals(0, tcStorage.get(carTCEnc, tcFlags, edge1, 0, edge2), .1);
+        assertEquals(0, tcStorage.get(truckTCEnc, tcFlags, edge1, 0, edge2), .1);
+        assertTrue(Double.isInfinite(tcStorage.get(bikeTCEnc, tcFlags, edge1, 0, edge2)));
 
-        tcStorage.readFlags(tcFlags, GHUtility.getEdge(graph, 3, 0).getEdge(), 0, GHUtility.getEdge(graph, 0, 2).getEdge());
-        assertEquals(0, carTCEnc.getDecimal(false, tcFlags), .1);
-        assertTrue(Double.isInfinite(truckTCEnc.getDecimal(false, tcFlags)));
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcFlags), .1);
+        edge1 = GHUtility.getEdge(graph, 3, 0).getEdge();
+        edge2 = GHUtility.getEdge(graph, 0, 2).getEdge();
+        assertEquals(0, tcStorage.get(carTCEnc, tcFlags, edge1, 0, edge2), .1);
+        assertTrue(Double.isInfinite(tcStorage.get(truckTCEnc, tcFlags, edge1, 0, edge2)));
+        assertEquals(0, tcStorage.get(bikeTCEnc, tcFlags, edge1, 0, edge2), .1);
     }
 
     @Test
@@ -797,36 +780,36 @@ public class OSMReaderTest {
 
         IntsRef tcFlags = TurnCost.createFlags();
         DecimalEncodedValue carTCEnc = hopper.getEncodingManager().getDecimalEncodedValue(TurnCost.key("car"));
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_8)) > 0);
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_3, n3, edge3_8)) > 0);
-        assertEquals(0, carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_4)), .1);
-        assertEquals(0, carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_2)), .1);
-        assertEquals(0, carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_4)), .1);
-        assertEquals(0, carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_3, n3, edge3_2)), .1);
-        assertEquals(0, carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge8_3, n3, edge3_2)), .1);
+        assertTrue(tcStorage.get(carTCEnc, tcFlags, edge2_3, n3, edge3_8) > 0);
+        assertTrue(tcStorage.get(carTCEnc,tcFlags, edge4_3, n3, edge3_8) > 0);
+        assertEquals(0, tcStorage.get(carTCEnc,tcFlags, edge2_3, n3, edge3_4), .1);
+        assertEquals(0, tcStorage.get(carTCEnc,tcFlags, edge2_3, n3, edge3_2), .1);
+        assertEquals(0, tcStorage.get(carTCEnc,tcFlags, edge2_3, n3, edge3_4), .1);
+        assertEquals(0, tcStorage.get(carTCEnc,tcFlags, edge4_3, n3, edge3_2), .1);
+        assertEquals(0, tcStorage.get(carTCEnc,tcFlags, edge8_3, n3, edge3_2), .1);
 
         DecimalEncodedValue bikeTCEnc = hopper.getEncodingManager().getDecimalEncodedValue(TurnCost.key("bike"));
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_8)), .1);
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_3, n3, edge3_8)), .1);
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_4)), .1);
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_2)), .1);
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge2_3, n3, edge3_4)), .1);
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_3, n3, edge3_2)), .1);
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge8_3, n3, edge3_2)), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge2_3, n3, edge3_8), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge4_3, n3, edge3_8), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge2_3, n3, edge3_4), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge2_3, n3, edge3_2), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge2_3, n3, edge3_4), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge4_3, n3, edge3_2), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge8_3, n3, edge3_2), .1);
 
         // u-turn except bus;bicycle restriction for (6-1)->(1-6) but not for (1-6)->(6-1)
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge1_6, n1, edge1_6)) > 0);
-        assertEquals(0, carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge1_6, n6, edge1_6)), .1);
+        assertTrue(tcStorage.get(carTCEnc,tcFlags, edge1_6, n1, edge1_6) > 0);
+        assertEquals(0, tcStorage.get(carTCEnc,tcFlags, edge1_6, n6, edge1_6), .1);
 
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge1_6, n1, edge1_6)), .1);
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge1_6, n6, edge1_6)), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge1_6, n1, edge1_6), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge1_6, n6, edge1_6), .1);
 
         // (4-5)->(5-6) right_turn_only dedicated to motorcar = (4-5)->(5-1) restricted
-        assertEquals(0, carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_5, n5, edge5_6)), .1);
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_5, n5, edge5_1)) > 0);
+        assertEquals(0, tcStorage.get(carTCEnc,tcFlags, edge4_5, n5, edge5_6), .1);
+        assertTrue(tcStorage.get(carTCEnc,tcFlags, edge4_5, n5, edge5_1) > 0);
 
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_5, n5, edge5_6)), .1);
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_5, n5, edge5_1)), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge4_5, n5, edge5_6), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge4_5, n5, edge5_1), .1);
     }
 
     @Test
@@ -857,20 +840,20 @@ public class OSMReaderTest {
         DecimalEncodedValue bikeTCEnc = hopper.getEncodingManager().getDecimalEncodedValue(TurnCost.key("bike"));
 
         // (1-2)->(2-3) no_right_turn for motorcar and bus
-        assertTrue(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge1_2, n2, edge2_3)) > 0);
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge1_2, n2, edge2_3)), .1);
+        assertTrue(tcStorage.get(carTCEnc,tcFlags, edge1_2, n2, edge2_3) > 0);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge1_2, n2, edge2_3), .1);
 
         // (3-4)->(4-5) no_right_turn for motorcycle and motorcar
-        assertTrue(Double.isInfinite(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge3_4, n4, edge4_5))));
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge3_4, n4, edge4_5)), .1);
+        assertTrue(Double.isInfinite(tcStorage.get(carTCEnc,tcFlags, edge3_4, n4, edge4_5)));
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge3_4, n4, edge4_5), .1);
 
         // (5-1)->(1-2) no_right_turn for bus and psv except for motorcar and bicycle
-        assertEquals(0, carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_5, n5, edge5_1)), .1);
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge4_5, n5, edge5_1)), .1);
+        assertEquals(0, tcStorage.get(carTCEnc,tcFlags, edge4_5, n5, edge5_1), .1);
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge4_5, n5, edge5_1), .1);
 
         // (5-1)->(1-2) no_right_turn for motorcar and motorcycle except for bus and bicycle
-        assertTrue(Double.isInfinite(carTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge5_1, n1, edge1_2))));
-        assertEquals(0, bikeTCEnc.getDecimal(false, tcStorage.readFlags(tcFlags, edge5_1, n1, edge1_2)), .1);
+        assertTrue(Double.isInfinite(tcStorage.get(carTCEnc,tcFlags, edge5_1, n1, edge1_2)));
+        assertEquals(0, tcStorage.get(bikeTCEnc,tcFlags, edge5_1, n1, edge1_2), .1);
     }
 
     @Test
@@ -974,8 +957,8 @@ public class OSMReaderTest {
 
             BikeFlagEncoder bikeEncoder;
             if (turnCosts) {
-                carEncoder = new CarFlagEncoder(5, 5, 1);
-                bikeEncoder = new BikeFlagEncoder(4, 2, 1);
+                carEncoder = new CarFlagEncoder(5, 5, 1, true);
+                bikeEncoder = new BikeFlagEncoder(4, 2, 1, true);
             } else {
                 carEncoder = new CarFlagEncoder();
                 bikeEncoder = new BikeFlagEncoder();