Codota Logo
FootFlagEncoder.getMaxSpeed
Code IndexAdd Codota to your IDE (free)

How to use
getMaxSpeed
method
in
com.graphhopper.routing.util.FootFlagEncoder

Best Java code snippets using com.graphhopper.routing.util.FootFlagEncoder.getMaxSpeed (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: graphhopper/graphhopper

  @Override
  public double getSpeed(long flags) {
    double speed = super.getSpeed(flags);
    if (speed == getMaxSpeed()) {
      // We cannot be sure if it was a long or a short trip
      return SHORT_TRIP_FERRY_SPEED;
    }
    return speed;
  }
}
origin: graphhopper/graphhopper

/**
 * @param weightToPrioMap associate a weight with every priority. This sorted map allows
 *                        subclasses to 'insert' more important priorities as well as overwrite determined priorities.
 */
void collect(ReaderWay way, TreeMap<Double, Integer> weightToPrioMap) {
  String highway = way.getTag("highway");
  if (way.hasTag("foot", "designated"))
    weightToPrioMap.put(100d, PREFER.getValue());
  double maxSpeed = getMaxSpeed(way);
  if (safeHighwayTags.contains(highway) || maxSpeed > 0 && maxSpeed <= 20) {
    weightToPrioMap.put(40d, PREFER.getValue());
    if (way.hasTag("tunnel", intendedValues)) {
      if (way.hasTag("sidewalk", sidewalksNoValues))
        weightToPrioMap.put(40d, AVOID_IF_POSSIBLE.getValue());
      else
        weightToPrioMap.put(40d, UNCHANGED.getValue());
    }
  } else if (maxSpeed > 50 || avoidHighwayTags.contains(highway)) {
    if (!way.hasTag("sidewalk", sidewalkValues))
      weightToPrioMap.put(45d, AVOID_IF_POSSIBLE.getValue());
  }
  if (way.hasTag("bicycle", "official") || way.hasTag("bicycle", "designated"))
    weightToPrioMap.put(44d, AVOID_IF_POSSIBLE.getValue());
}
origin: graphhopper/graphhopper

@Test
public void testFerrySpeed() {
  ReaderWay way = new ReaderWay(1);
  way.setTag("route", "ferry");
  // a bit longer than an hour
  way.setTag("duration:seconds", "4000");
  long flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0);
  assertTrue(footEncoder.getSpeed(flags) > footEncoder.getMaxSpeed());
  assertEquals(20, footEncoder.getSpeed(flags), .1);
}
origin: com.graphhopper/graphhopper-core

  @Override
  public double getSpeed(long flags) {
    double speed = super.getSpeed(flags);
    if (speed == getMaxSpeed()) {
      // We cannot be sure if it was a long or a short trip
      return SHORT_TRIP_FERRY_SPEED;
    }
    return speed;
  }
}
origin: com.graphhopper/graphhopper-core

/**
 * @param weightToPrioMap associate a weight with every priority. This sorted map allows
 *                        subclasses to 'insert' more important priorities as well as overwrite determined priorities.
 */
void collect(ReaderWay way, TreeMap<Double, Integer> weightToPrioMap) {
  String highway = way.getTag("highway");
  if (way.hasTag("foot", "designated"))
    weightToPrioMap.put(100d, PREFER.getValue());
  double maxSpeed = getMaxSpeed(way);
  if (safeHighwayTags.contains(highway) || maxSpeed > 0 && maxSpeed <= 20) {
    weightToPrioMap.put(40d, PREFER.getValue());
    if (way.hasTag("tunnel", intendedValues)) {
      if (way.hasTag("sidewalk", sidewalksNoValues))
        weightToPrioMap.put(40d, AVOID_IF_POSSIBLE.getValue());
      else
        weightToPrioMap.put(40d, UNCHANGED.getValue());
    }
  } else if (maxSpeed > 50 || avoidHighwayTags.contains(highway)) {
    if (!way.hasTag("sidewalk", sidewalkValues))
      weightToPrioMap.put(45d, AVOID_IF_POSSIBLE.getValue());
  }
  if (way.hasTag("bicycle", "official") || way.hasTag("bicycle", "designated"))
    weightToPrioMap.put(44d, AVOID_IF_POSSIBLE.getValue());
}
origin: com.graphhopper/graphhopper

/**
 * @param weightToPrioMap associate a weight with every priority. This sorted map allows
 * subclasses to 'insert' more important priorities as well as overwrite determined priorities.
 */
void collect( OSMWay way, TreeMap<Double, Integer> weightToPrioMap )
{
  String highway = way.getTag("highway");
  if (way.hasTag("foot", "designated"))
    weightToPrioMap.put(100d, PREFER.getValue());
  double maxSpeed = getMaxSpeed(way);
  if (safeHighwayTags.contains(highway) || maxSpeed > 0 && maxSpeed <= 20)
  {
    weightToPrioMap.put(40d, PREFER.getValue());
    if (way.hasTag("tunnel", intendedValues))
    {
      if (way.hasTag("sidewalk", sidewalksNoValues))
        weightToPrioMap.put(40d, AVOID_IF_POSSIBLE.getValue());
      else
        weightToPrioMap.put(40d, UNCHANGED.getValue());
    }
  } else if (maxSpeed > 50 || avoidHighwayTags.contains(highway))
  {
    if (!way.hasTag("sidewalk", sidewalkValues))
      weightToPrioMap.put(45d, AVOID_IF_POSSIBLE.getValue());
  }
  if (way.hasTag("bicycle", "official") || way.hasTag("bicycle", "designated"))
    weightToPrioMap.put(44d, AVOID_IF_POSSIBLE.getValue());
}
origin: com.rgi-corp/graphhopper

/**
 * @param weightToPrioMap associate a weight with every priority. This sorted map allows
 *                        subclasses to 'insert' more important priorities as well as overwrite determined priorities.
 */
void collect(ReaderWay way, TreeMap<Double, Integer> weightToPrioMap) {
  String highway = way.getTag("highway");
  if (way.hasTag("foot", "designated"))
    weightToPrioMap.put(100d, PREFER.getValue());
  double maxSpeed = getMaxSpeed(way);
  if (safeHighwayTags.contains(highway) || maxSpeed > 0 && maxSpeed <= 20) {
    weightToPrioMap.put(40d, PREFER.getValue());
    if (way.hasTag("tunnel", intendedValues)) {
      if (way.hasTag("sidewalk", sidewalksNoValues))
        weightToPrioMap.put(40d, AVOID_IF_POSSIBLE.getValue());
      else
        weightToPrioMap.put(40d, UNCHANGED.getValue());
    }
  } else if (maxSpeed > 50 || avoidHighwayTags.contains(highway)) {
    if (!way.hasTag("sidewalk", sidewalkValues))
      weightToPrioMap.put(45d, AVOID_IF_POSSIBLE.getValue());
  }
  if (way.hasTag("bicycle", "official") || way.hasTag("bicycle", "designated"))
    weightToPrioMap.put(44d, AVOID_IF_POSSIBLE.getValue());
}
com.graphhopper.routing.utilFootFlagEncodergetMaxSpeed

Popular methods of FootFlagEncoder

  • <init>
  • handlePriority
  • setBlockByDefault
  • setBlockFords
  • collect
  • getFerrySpeed
  • isAccept
  • isBlockFords
  • isFerry
  • setBool
  • setSpeed
  • supports
  • setSpeed,
  • supports,
  • getConditionalTagInspector,
  • init,
  • acceptWay,
  • flagsDefault,
  • getReverseSpeed,
  • getSpeed,
  • getTurnCost

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now