title: Allow vehicle through private road OSM GraphHopper
body: <p>I am trying to modify <a href="https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java" rel="nofollow">CarFlagEncoder.java</a> so that GraphHopper will use two pieces of road which it does not by default:</p>
  
  <p><a href="http://www.openstreetmap.org/way/181263007" rel="nofollow">http://www.openstreetmap.org/way/181263007</a><br>
  <a href="http://www.openstreetmap.org/way/37720333" rel="nofollow">http://www.openstreetmap.org/way/37720333</a></p>
  
  <p>Am I right in saying that to allow access to this road it is as simple as removing <code>restrictedValues.add("private")</code> from the <code>public CarFlagEncoder( int speedBits, double speedFactor, int maxTurnCosts )</code> method?</p>
  
  <pre><code>public CarFlagEncoder( int speedBits, double speedFactor, int maxTurnCosts )
  {
      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");
      restrictedValues.add("restricted");
      restrictedValues.add("delivery");
      restrictedValues.add("military");
  </code></pre>
  
  <p>It's either there or in the <code>acceptWay</code> method that I need to modify:</p>
  
  <pre><code>@Override
  public long acceptWay( OSMWay way )
  {
      String highwayValue = way.getTag("highway");
      if (highwayValue == null)
      {
          if (way.hasTag("route", ferries))
          {
              String motorcarTag = way.getTag("motorcar");
              if (motorcarTag == null)
                  motorcarTag = way.getTag("motor_vehicle");
  
              if (motorcarTag == null &amp;&amp; !way.hasTag("foot") &amp;&amp; !way.hasTag("bicycle") || "yes".equals(motorcarTag))
                  return acceptBit | ferryBit;
          }
          return 0;
      }
  
      if ("track".equals(highwayValue))
      {
          String tt = way.getTag("tracktype");
          if (tt != null &amp;&amp; !tt.equals("grade1") &amp;&amp; !tt.equals("grade2") &amp;&amp; !tt.equals("grade3"))
              return 0;
      }
  
      if (!defaultSpeedMap.containsKey(highwayValue))
          return 0;
  
      if (way.hasTag("impassable", "yes") || way.hasTag("status", "impassable"))
          return 0;
  
      // multiple restrictions needs special handling compared to foot and bike, see also motorcycle
      String firstValue = way.getFirstPriorityTag(restrictions);
      if (!firstValue.isEmpty())
      {
          if (restrictedValues.contains(firstValue))
              return 0;
          if (intendedValues.contains(firstValue))
              return acceptBit;
      }
  
      // do not drive street cars into fords
      if (isBlockFords() &amp;&amp; ("ford".equals(highwayValue) || way.hasTag("ford")))
          return 0;
  
      // do not drive cars over railways (sometimes incorrectly mapped!)
      if (way.hasTag("railway") &amp;&amp; !way.hasTag("railway", acceptedRailways))
          return 0;
  
      return acceptBit;
  }
  </code></pre>
  
  <p>If anyone can please explain the best way to do this I would be very appreciative.</p>