Class TravelOptions

java.lang.Object
com.targomo.client.api.TravelOptions
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
StatisticTravelOptions

@Entity public class TravelOptions extends Object implements Serializable
Common configuration class for executing all requests. Define source points, target points and other configuration values such as travel times, elevation etc. here. See: PolygonRequest, RouteRequest, TimeRequest, ReachabilityRequest.
See Also:
  • Constructor Details

    • TravelOptions

      public TravelOptions()
  • Method Details

    • setTravelType

      public void setTravelType(TravelType type)
      Set the travel type to use when routing.
    • getSourceCoordinates

      public double[][] getSourceCoordinates()
      Returns:
      source coordinates array
    • getTargetCoordinates

      public double[][] getTargetCoordinates()
      Returns:
      target coordinates array
    • addAllTargets

      public void addAllTargets(Map<String,Coordinate> targets)
      Parameters:
      targets - add all specified targets to the target map
    • addAllTargets

      public void addAllTargets(Collection<Coordinate> targets)
      Parameters:
      targets - add all specified targets to the target map using their ID as key
    • addAllTargetGeohashes

      public void addAllTargetGeohashes(List<String> geohashes)
    • addAllTargetAddresses

      public void addAllTargetAddresses(List<String> targetAddresses)
    • getMaxRoutingTime

      @Deprecated public int getMaxRoutingTime()
      Deprecated.
      This function will be removed in a future release. Use maxEdgeWeight and edgeWeightType instead.
      Returns:
      the maxRoutingTime
    • setMaxRoutingTime

      @Deprecated public void setMaxRoutingTime(int maxRoutingTime)
      Deprecated.
      This function will be removed in a future release. Use maxEdgeWeight and edgeWeightType instead.
      Parameters:
      maxRoutingTime - the maxRoutingTime to set
    • getMaxRoutingLength

      @Deprecated public Integer getMaxRoutingLength()
      Deprecated.
      This function will be removed in a future release. Use maxEdgeWeight and edgeWeightType instead.
      Returns:
      the maxRoutingLength
    • setMaxRoutingLength

      @Deprecated public void setMaxRoutingLength(Integer maxRoutingLength)
      Deprecated.
      This function will be removed in a future release. Use maxEdgeWeight and edgeWeightType instead.
      Parameters:
      maxRoutingLength - the maxRoutingLength to set
    • addSource

      public void addSource(Coordinate source)
      Parameters:
      source - Source coordinate
    • addSourceGeometry

      public void addSourceGeometry(AbstractGeometry source)
      Parameters:
      source - Source geometry
    • addSourceAddress

      public void addSourceAddress(DefaultSourceAddress address)
    • addTarget

      public void addTarget(Coordinate target)
      Parameters:
      target - Target coordinate
    • addTargetGeohash

      public void addTargetGeohash(String geoHash)
      Parameters:
      geoHash - Geohash string
    • getSource

      public Coordinate getSource(String id)
      Parameters:
      id - ID of source Coordinate
      Returns:
      Source coordinate
    • getSourcegeometry

      public AbstractGeometry getSourcegeometry(String id)
      Parameters:
      id - ID of source geometry
      Returns:
      Source geometry
    • getTarget

      public Coordinate getTarget(String id)
      Parameters:
      id - ID of source Coordinate
      Returns:
      Target coordinate
    • addAllSources

      public void addAllSources(Map<String,Coordinate> sources)
    • addAllSourceGeometries

      public void addAllSourceGeometries(Map<String,AbstractGeometry> sourceGeometries)
    • clearAndAddSource

      public void clearAndAddSource(String id, Coordinate source)
      Clear sources and add new one
      Parameters:
      id - ID for the new source
      source - New source coordinate
    • clearAndAddSource

      public void clearAndAddSource(String id, AbstractGeometry source)
      Clear sourceGeometries and add new one
      Parameters:
      id - ID for the new source
      source - New source geometry
    • getTravelTypesString

      public String getTravelTypesString()
    • getTravelType

      public TravelType getTravelType() throws TargomoClientException
      Deprecated.
      for backwards compatibility
      Returns the travel type used in the travel options. Throws an exception if there are more than one travel type, use `getTravelTypes()` in this case instead.
      Returns:
      the travel type
      Throws:
      TargomoClientException - if there is more than one travel type
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object