Package com.targomo.client.api
Class TravelOptions
java.lang.Object
com.targomo.client.api.TravelOptions
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
StatisticTravelOptions
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllSourceGeometries(Map<String, AbstractGeometry> sourceGeometries) voidaddAllSources(Map<String, Coordinate> sources) voidaddAllTargetAddresses(List<String> targetAddresses) voidaddAllTargetGeohashes(List<String> geohashes) voidaddAllTargets(Collection<Coordinate> targets) voidaddAllTargets(Map<String, Coordinate> targets) voidaddSource(Coordinate source) voidaddSourceAddress(DefaultSourceAddress address) voidaddSourceGeometry(AbstractGeometry source) voidaddTarget(Coordinate target) voidaddTargetGeohash(String geoHash) voidclearAndAddSource(String id, AbstractGeometry source) Clear sourceGeometries and add new onevoidclearAndAddSource(String id, Coordinate source) Clear sources and add new onebooleanDeprecated.intDeprecated.double[][]double[][]Deprecated.for backwards compatibilityinthashCode()voidsetMaxRoutingLength(Integer maxRoutingLength) Deprecated.voidsetMaxRoutingTime(int maxRoutingTime) Deprecated.voidsetTravelType(TravelType type) Set the travel type to use when routing.toString()
-
Constructor Details
-
TravelOptions
public TravelOptions()
-
-
Method Details
-
setTravelType
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
- Parameters:
targets- add all specified targets to the target map
-
addAllTargets
- Parameters:
targets- add all specified targets to the target map using their ID as key
-
addAllTargetGeohashes
-
addAllTargetAddresses
-
getMaxRoutingTime
Deprecated.This function will be removed in a future release. Use maxEdgeWeight and edgeWeightType instead.- Returns:
- the maxRoutingTime
-
setMaxRoutingTime
Deprecated.This function will be removed in a future release. Use maxEdgeWeight and edgeWeightType instead.- Parameters:
maxRoutingTime- the maxRoutingTime to set
-
getMaxRoutingLength
Deprecated.This function will be removed in a future release. Use maxEdgeWeight and edgeWeightType instead.- Returns:
- the maxRoutingLength
-
setMaxRoutingLength
Deprecated.This function will be removed in a future release. Use maxEdgeWeight and edgeWeightType instead.- Parameters:
maxRoutingLength- the maxRoutingLength to set
-
addSource
- Parameters:
source- Source coordinate
-
addSourceGeometry
- Parameters:
source- Source geometry
-
addSourceAddress
-
addTarget
- Parameters:
target- Target coordinate
-
addTargetGeohash
- Parameters:
geoHash- Geohash string
-
getSource
- Parameters:
id- ID of source Coordinate- Returns:
- Source coordinate
-
getSourcegeometry
- Parameters:
id- ID of source geometry- Returns:
- Source geometry
-
getTarget
- Parameters:
id- ID of source Coordinate- Returns:
- Target coordinate
-
addAllSources
-
addAllSourceGeometries
-
clearAndAddSource
Clear sources and add new one- Parameters:
id- ID for the new sourcesource- New source coordinate
-
clearAndAddSource
Clear sourceGeometries and add new one- Parameters:
id- ID for the new sourcesource- New source geometry
-
getTravelTypesString
-
getTravelType
Deprecated.for backwards compatibilityReturns 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
-
hashCode
public int hashCode() -
toString
-