Class GHRequest

java.lang.Object
com.graphhopper.GHRequest

public class GHRequest extends Object
Request object to perform routing with GraphHopper.
Author:
Peter Karich, ratrun
  • Constructor Details

    • GHRequest

      public GHRequest()
    • GHRequest

      public GHRequest(int size)
    • GHRequest

      public GHRequest(double fromLat, double fromLon, double toLat, double toLon)
      Creates a routing request from one point (fromLat, fromLon) to another (toLat, toLon)
    • GHRequest

      public GHRequest(GHPoint startPlace, GHPoint endPlace)
    • GHRequest

      public GHRequest(List<GHPoint> points)
      Parameters:
      points - List of stopover points in order: start, 1st stop, 2nd stop, ..., end
  • Method Details

    • setPoints

      public GHRequest setPoints(List<GHPoint> points)
    • getPoints

      public List<GHPoint> getPoints()
    • addPoint

      public GHRequest addPoint(GHPoint point)
      Add stopover point to routing request.
      Parameters:
      point - geographical position (see GHPoint)
    • setHeadings

      public GHRequest setHeadings(List<Double> headings)
      Sets the headings, i.e. the direction the route should leave the starting point and the directions the route should arrive from at the via-points and the end point. Each heading is given as north based azimuth (clockwise) in [0, 360) or NaN if no direction shall be specified.

      The number of headings must be zero (default), one (for the start point) or equal to the number of points when sending the request.

    • getHeadings

      public List<Double> getHeadings()
    • isAzimuthValue

      public static boolean isAzimuthValue(double heading)
    • getAlgorithm

      public String getAlgorithm()
    • setAlgorithm

      public GHRequest setAlgorithm(String algo)
      For possible values see AlgorithmOptions.*
    • getLocale

      public Locale getLocale()
    • setLocale

      public GHRequest setLocale(Locale locale)
    • setLocale

      public GHRequest setLocale(String localeStr)
    • getCustomModel

      public CustomModel getCustomModel()
    • setCustomModel

      public GHRequest setCustomModel(CustomModel customModel)
    • getProfile

      public String getProfile()
    • setProfile

      public GHRequest setProfile(String profile)
    • getHints

      public PMap getHints()
    • putHint

      public GHRequest putHint(String fieldName, Object value)
      This method sets a key value pair in the hints and is unrelated to the setPointHints method. It is mainly used for deserialization with Jackson.
      See Also:
    • setPointHints

      public GHRequest setPointHints(List<String> pointHints)
    • getPointHints

      public List<String> getPointHints()
    • setCurbsides

      public GHRequest setCurbsides(List<String> curbsides)
    • getCurbsides

      public List<String> getCurbsides()
    • hasSnapPreventions

      public boolean hasSnapPreventions()
    • setSnapPreventions

      public GHRequest setSnapPreventions(List<String> snapPreventions)
    • getSnapPreventions

      public List<String> getSnapPreventions()
    • setPathDetails

      public GHRequest setPathDetails(List<String> pathDetails)
    • getPathDetails

      public List<String> getPathDetails()
    • toString

      public String toString()
      Overrides:
      toString in class Object