Class OSMMaxSpeedParser

java.lang.Object
com.graphhopper.routing.util.parsers.OSMMaxSpeedParser
All Implemented Interfaces:
TagParser

public class OSMMaxSpeedParser extends Object implements TagParser
  • Field Details

    • MAXSPEED_NONE

      public static final double MAXSPEED_NONE
      Special value to represent `maxspeed=none` internally, not exposed via the maxspeed encoded value
      See Also:
  • Constructor Details

  • Method Details

    • handleWayTags

      public void handleWayTags(int edgeId, EdgeIntAccess edgeIntAccess, ReaderWay way, IntsRef relationFlags)
      Specified by:
      handleWayTags in interface TagParser
    • parseMaxSpeed

      public static double parseMaxSpeed(ReaderWay way, boolean reverse)
      Returns:
      The maxspeed for the given way. It can be anything between 0 and
      invalid reference
      MaxSpeed.MAXSPEED_150
      , or
      invalid reference
      MaxSpeed.MAXSPEED_MISSING
      in case there is no valid maxspeed tagged for this way in this direction.
    • parseMaxspeedString

      public static double parseMaxspeedString(String str)
      Returns:
      the speed in km/h, or
      invalid reference
      MAXSPEED_MISSING
      if the string is invalid, or MAXSPEED_NONE in case it equals 'none'