Class RoutingRequest

java.lang.Object
com.massifmaps.routing.RoutingRequest

public class RoutingRequest extends Object
A class that defines required attributes for routing (end points, etc).
  • Constructor Summary

    Constructors
    Constructor
    Description
    RoutingRequest(Projection projection, MapPosVector points)
    Constructs a new RoutingRequest instance from projection and via points.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if this object is equal to the specified object.
    Returns the custom parameter value of the request.
    getPointParameter(int index, String param)
    Returns the parameter value for the given routing point.
    Returns the point list of the request.
    Returns the projection of the points in the request.
    int
    Returns the hash value of this object.
    void
    Sets a custom parameter value for the the request.
    void
    setPointParameter(int index, String param, Variant value)
    Sets the parameter value for the given routing point.
    This is currently supported by Valhalla routing engine and can be used to specify initial or final heading, for example.
    In addition to Valhalla, SGRE routing engine supports 'geometry_tag_filter' parameter for specifying how to filter matching edges.
    Creates a string representation of this request object, useful for logging.

    Methods inherited from class java.lang.Object

    clone, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RoutingRequest

      public RoutingRequest(Projection projection, MapPosVector points)
      Constructs a new RoutingRequest instance from projection and via points.
      Parameters:
      projection - The projection of the points.
      points - The list of points that the route must pass. Must contains at least 2 elements.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Checks if this object is equal to the specified object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The reference object.
      Returns:
      True when objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash value of this object.
      Overrides:
      hashCode in class Object
      Returns:
      The hash value of this object.
    • getProjection

      public Projection getProjection()
      Returns the projection of the points in the request.
      Returns:
      The projection of the request.
    • getPoints

      public MapPosVector getPoints()
      Returns the point list of the request.
      Returns:
      The point list of the request.
    • getPointParameter

      public Variant getPointParameter(int index, String param)
      Returns the parameter value for the given routing point.
      Parameters:
      index - The routing point index.
      param - The name of the parameter.
      Returns:
      The value of the specified parameter of the given routing point. If the parameter does not exist, empty variant is returned.
    • setPointParameter

      public void setPointParameter(int index, String param, Variant value)
      Sets the parameter value for the given routing point.
      This is currently supported by Valhalla routing engine and can be used to specify initial or final heading, for example.
      In addition to Valhalla, SGRE routing engine supports 'geometry_tag_filter' parameter for specifying how to filter matching edges.
      Parameters:
      index - The routing point index.
      param - The name of the parameter to set.
      value - The new value for the parameter of the given routing point.
    • getCustomParameter

      public Variant getCustomParameter(String param)
      Returns the custom parameter value of the request.
      Parameters:
      param - The name of the parameter to return.
      Returns:
      The value of the parameter. If the parameter does not exist, empty variant is returned.
    • setCustomParameter

      public void setCustomParameter(String param, Variant value)
      Sets a custom parameter value for the the request.
      Parameters:
      param - The name of the parameter. For example, "trace_options.search_radius".
      value - The new value for the parameter.
    • toString

      public String toString()
      Creates a string representation of this request object, useful for logging.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this request object.