Class RouteOptions
Class RouteOptions
- java.lang.Object
-
- com.here.sdk.routing.RouteOptions
-
public final class RouteOptions extends java.lang.ObjectThe options to specify how the route will be calculated.
-
-
Field Summary
Fields Modifier and Type Field Description intalternativesMaximum number of alternative routes that will be calculated, in addition to the best one.java.util.DatearrivalTimeOptional time when travel is expected to end.java.util.DatedepartureTimeOptional time when travel is expected to start.booleanenableRouteHandleA flag that indicates whether the resulting route should contain aRouteHandle.booleanenableRouteLabelsSpecifies whether route labels should be included in the route response.booleanenableTollsA flag that indicates whether the resulting routeSection.getTolls()properties should contain tolls data.OptimizationModeoptimizationModeThe optimization mode to be used for route calculation.booleanoptimizeWaypointsOrderA flag that indicates whether the order of waypoints that is passed tocalculateRoute()should be optimized in the best order.java.lang.DoublespeedCapInMetersPerSecondSpecifies the maximum speed in meters per second, which the user wishes not to exceed.TrafficOptimizationModetrafficOptimizationModeThe traffic optimization mode to be used for route calculation.
-
Constructor Summary
Constructors Constructor Description RouteOptions()Creates a new instance.RouteOptions(OptimizationMode optimizationMode)Creates a new instance.RouteOptions(OptimizationMode optimizationMode, int alternatives)Creates a new instance.RouteOptions(OptimizationMode optimizationMode, int alternatives, java.util.Date departureTime)Creates a new instance.RouteOptions(OptimizationMode optimizationMode, int alternatives, java.util.Date departureTime, java.util.Date arrivalTime)Creates a new instance.RouteOptions(OptimizationMode optimizationMode, int alternatives, java.util.Date departureTime, java.util.Date arrivalTime, java.lang.Double speedCapInMetersPerSecond)Creates a new instance.RouteOptions(OptimizationMode optimizationMode, int alternatives, java.util.Date departureTime, java.util.Date arrivalTime, java.lang.Double speedCapInMetersPerSecond, boolean enableRouteHandle)Creates a new instance.RouteOptions(OptimizationMode optimizationMode, int alternatives, java.util.Date departureTime, java.util.Date arrivalTime, java.lang.Double speedCapInMetersPerSecond, boolean enableRouteHandle, TrafficOptimizationMode trafficOptimizationMode)Creates a new instance.RouteOptions(OptimizationMode optimizationMode, int alternatives, java.util.Date departureTime, java.util.Date arrivalTime, java.lang.Double speedCapInMetersPerSecond, boolean enableRouteHandle, TrafficOptimizationMode trafficOptimizationMode, boolean enableTolls)Creates a new instance.RouteOptions(OptimizationMode optimizationMode, int alternatives, java.util.Date departureTime, java.util.Date arrivalTime, java.lang.Double speedCapInMetersPerSecond, boolean enableRouteHandle, TrafficOptimizationMode trafficOptimizationMode, boolean enableTolls, boolean optimizeWaypointsOrder)Creates a new instance.RouteOptions(OptimizationMode optimizationMode, int alternatives, java.util.Date departureTime, java.util.Date arrivalTime, java.lang.Double speedCapInMetersPerSecond, boolean enableRouteHandle, TrafficOptimizationMode trafficOptimizationMode, boolean enableTolls, boolean optimizeWaypointsOrder, boolean enableRouteLabels)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()
-
-
-
Field Detail
-
optimizationMode
@NonNull public OptimizationMode optimizationMode
The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.
-
alternatives
public int alternatives
Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
-
departureTime
@Nullable public java.util.Date departureTime
Optional time when travel is expected to start. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, i.e. now. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both departure time and
arrivalTimecannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both departure time and
-
arrivalTime
@Nullable public java.util.Date arrivalTime
Optional time when travel is expected to end. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, to predict the arrival time. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both
departureTimeand arrival time cannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both
-
speedCapInMetersPerSecond
@Nullable public java.lang.Double speedCapInMetersPerSecond
Specifies the maximum speed in meters per second, which the user wishes not to exceed. The valid range is [1, 70] meters per second. Note that it is valid only for
TransportMode.CAR,TransportMode.TRUCKandTransportMode.SCOOTERtransport modes. For car, truck and scooter transport modes, it will affectRoute.getDuration()of the route. Only for scooter transport mode, it may affect the route geometry. Defaults tonull, which means that no speed cap is set.
-
enableRouteHandle
public boolean enableRouteHandle
A flag that indicates whether the resulting route should contain a
RouteHandle. Defaults tofalse. Note that aRouteHandlegenerated by the onlineRoutingEngineis not compatible with theOfflineRoutingEngineand vice versa.
-
trafficOptimizationMode
@NonNull public TrafficOptimizationMode trafficOptimizationMode
The traffic optimization mode to be used for route calculation. By default, it is
TrafficOptimizationMode.TIME_DEPENDENT, which enables traffic-aware routing.
-
enableTolls
public boolean enableTolls
A flag that indicates whether the resulting route
Section.getTolls()properties should contain tolls data. Defaults tofalse.Note: When a route calculation request asks tolls, a pricing scheme with higher rates might be applied. Consult your HERE representative to get more information on the related pricing schemes.
Note: For users of the
OfflineRoutingEnginethis is a beta release of this feature, so there could be a few bugs and unexpected behaviors. TheOfflineRoutingEngineis available for editions such as the Navigate Edition. For users of theRoutingEnginethe feature is stable.
-
optimizeWaypointsOrder
public boolean optimizeWaypointsOrder
A flag that indicates whether the order of waypoints that is passed to
calculateRoute()should be optimized in the best order. The best order is calculated by the same metrics that are used during regular calculation, e.g.OptimizationMode. The starting and destinationWaypointare not reordered. If the whole number of waypoints is fewer than 4 - the flag doesn't affect the resulting route (nothing to optimize). The resulting order of waypoints can be identified by their waypoint indices in the route sections (seeRoute.getSections(),Section.getDeparturePlace(),Section.getArrivalPlace(),RoutePlace.waypointIndex). Currently, the waypoints order optimization is available only when using theOfflineRoutingEngine(not available for all editions). Defaults tofalse.
-
enableRouteLabels
public boolean enableRouteLabels
Specifies whether route labels should be included in the route response. Route labels identify major highways or road names along the route. By default, this is set to
false.
-
-
Constructor Detail
-
RouteOptions
public RouteOptions()
Creates a new instance.
-
RouteOptions
public RouteOptions(@NonNull OptimizationMode optimizationMode)Creates a new instance.
- Parameters:
optimizationMode-The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.
-
RouteOptions
public RouteOptions(@NonNull OptimizationMode optimizationMode, int alternatives)Creates a new instance.
- Parameters:
optimizationMode-The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.alternatives-Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
-
RouteOptions
public RouteOptions(@NonNull OptimizationMode optimizationMode, int alternatives, @Nullable java.util.Date departureTime)Creates a new instance.
- Parameters:
optimizationMode-The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.alternatives-Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
departureTime-Optional time when travel is expected to start. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, i.e. now. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both departure time and
arrivalTimecannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both departure time and
-
RouteOptions
public RouteOptions(@NonNull OptimizationMode optimizationMode, int alternatives, @Nullable java.util.Date departureTime, @Nullable java.util.Date arrivalTime)Creates a new instance.
- Parameters:
optimizationMode-The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.alternatives-Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
departureTime-Optional time when travel is expected to start. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, i.e. now. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both departure time and
arrivalTimecannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both departure time and
arrivalTime-Optional time when travel is expected to end. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, to predict the arrival time. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both
departureTimeand arrival time cannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both
-
RouteOptions
public RouteOptions(@NonNull OptimizationMode optimizationMode, int alternatives, @Nullable java.util.Date departureTime, @Nullable java.util.Date arrivalTime, @Nullable java.lang.Double speedCapInMetersPerSecond)Creates a new instance.
- Parameters:
optimizationMode-The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.alternatives-Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
departureTime-Optional time when travel is expected to start. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, i.e. now. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both departure time and
arrivalTimecannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both departure time and
arrivalTime-Optional time when travel is expected to end. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, to predict the arrival time. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both
departureTimeand arrival time cannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both
speedCapInMetersPerSecond-Specifies the maximum speed in meters per second, which the user wishes not to exceed. The valid range is [1, 70] meters per second. Note that it is valid only for
TransportMode.CAR,TransportMode.TRUCKandTransportMode.SCOOTERtransport modes. For car, truck and scooter transport modes, it will affectRoute.getDuration()of the route. Only for scooter transport mode, it may affect the route geometry. Defaults tonull, which means that no speed cap is set.
-
RouteOptions
public RouteOptions(@NonNull OptimizationMode optimizationMode, int alternatives, @Nullable java.util.Date departureTime, @Nullable java.util.Date arrivalTime, @Nullable java.lang.Double speedCapInMetersPerSecond, boolean enableRouteHandle)Creates a new instance.
- Parameters:
optimizationMode-The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.alternatives-Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
departureTime-Optional time when travel is expected to start. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, i.e. now. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both departure time and
arrivalTimecannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both departure time and
arrivalTime-Optional time when travel is expected to end. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, to predict the arrival time. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both
departureTimeand arrival time cannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both
speedCapInMetersPerSecond-Specifies the maximum speed in meters per second, which the user wishes not to exceed. The valid range is [1, 70] meters per second. Note that it is valid only for
TransportMode.CAR,TransportMode.TRUCKandTransportMode.SCOOTERtransport modes. For car, truck and scooter transport modes, it will affectRoute.getDuration()of the route. Only for scooter transport mode, it may affect the route geometry. Defaults tonull, which means that no speed cap is set.enableRouteHandle-A flag that indicates whether the resulting route should contain a
RouteHandle. Defaults tofalse. Note that aRouteHandlegenerated by the onlineRoutingEngineis not compatible with theOfflineRoutingEngineand vice versa.
-
RouteOptions
public RouteOptions(@NonNull OptimizationMode optimizationMode, int alternatives, @Nullable java.util.Date departureTime, @Nullable java.util.Date arrivalTime, @Nullable java.lang.Double speedCapInMetersPerSecond, boolean enableRouteHandle, @NonNull TrafficOptimizationMode trafficOptimizationMode)Creates a new instance.
- Parameters:
optimizationMode-The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.alternatives-Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
departureTime-Optional time when travel is expected to start. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, i.e. now. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both departure time and
arrivalTimecannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both departure time and
arrivalTime-Optional time when travel is expected to end. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, to predict the arrival time. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both
departureTimeand arrival time cannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both
speedCapInMetersPerSecond-Specifies the maximum speed in meters per second, which the user wishes not to exceed. The valid range is [1, 70] meters per second. Note that it is valid only for
TransportMode.CAR,TransportMode.TRUCKandTransportMode.SCOOTERtransport modes. For car, truck and scooter transport modes, it will affectRoute.getDuration()of the route. Only for scooter transport mode, it may affect the route geometry. Defaults tonull, which means that no speed cap is set.enableRouteHandle-A flag that indicates whether the resulting route should contain a
RouteHandle. Defaults tofalse. Note that aRouteHandlegenerated by the onlineRoutingEngineis not compatible with theOfflineRoutingEngineand vice versa.trafficOptimizationMode-The traffic optimization mode to be used for route calculation. By default, it is
TrafficOptimizationMode.TIME_DEPENDENT, which enables traffic-aware routing.
-
RouteOptions
public RouteOptions(@NonNull OptimizationMode optimizationMode, int alternatives, @Nullable java.util.Date departureTime, @Nullable java.util.Date arrivalTime, @Nullable java.lang.Double speedCapInMetersPerSecond, boolean enableRouteHandle, @NonNull TrafficOptimizationMode trafficOptimizationMode, boolean enableTolls)Creates a new instance.
- Parameters:
optimizationMode-The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.alternatives-Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
departureTime-Optional time when travel is expected to start. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, i.e. now. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both departure time and
arrivalTimecannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both departure time and
arrivalTime-Optional time when travel is expected to end. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, to predict the arrival time. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both
departureTimeand arrival time cannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both
speedCapInMetersPerSecond-Specifies the maximum speed in meters per second, which the user wishes not to exceed. The valid range is [1, 70] meters per second. Note that it is valid only for
TransportMode.CAR,TransportMode.TRUCKandTransportMode.SCOOTERtransport modes. For car, truck and scooter transport modes, it will affectRoute.getDuration()of the route. Only for scooter transport mode, it may affect the route geometry. Defaults tonull, which means that no speed cap is set.enableRouteHandle-A flag that indicates whether the resulting route should contain a
RouteHandle. Defaults tofalse. Note that aRouteHandlegenerated by the onlineRoutingEngineis not compatible with theOfflineRoutingEngineand vice versa.trafficOptimizationMode-The traffic optimization mode to be used for route calculation. By default, it is
TrafficOptimizationMode.TIME_DEPENDENT, which enables traffic-aware routing.enableTolls-A flag that indicates whether the resulting route
Section.getTolls()properties should contain tolls data. Defaults tofalse.Note: When a route calculation request asks tolls, a pricing scheme with higher rates might be applied. Consult your HERE representative to get more information on the related pricing schemes.
Note: For users of the
OfflineRoutingEnginethis is a beta release of this feature, so there could be a few bugs and unexpected behaviors. TheOfflineRoutingEngineis available for editions such as the Navigate Edition. For users of theRoutingEnginethe feature is stable.
-
RouteOptions
public RouteOptions(@NonNull OptimizationMode optimizationMode, int alternatives, @Nullable java.util.Date departureTime, @Nullable java.util.Date arrivalTime, @Nullable java.lang.Double speedCapInMetersPerSecond, boolean enableRouteHandle, @NonNull TrafficOptimizationMode trafficOptimizationMode, boolean enableTolls, boolean optimizeWaypointsOrder)Creates a new instance.
- Parameters:
optimizationMode-The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.alternatives-Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
departureTime-Optional time when travel is expected to start. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, i.e. now. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both departure time and
arrivalTimecannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both departure time and
arrivalTime-Optional time when travel is expected to end. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, to predict the arrival time. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both
departureTimeand arrival time cannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both
speedCapInMetersPerSecond-Specifies the maximum speed in meters per second, which the user wishes not to exceed. The valid range is [1, 70] meters per second. Note that it is valid only for
TransportMode.CAR,TransportMode.TRUCKandTransportMode.SCOOTERtransport modes. For car, truck and scooter transport modes, it will affectRoute.getDuration()of the route. Only for scooter transport mode, it may affect the route geometry. Defaults tonull, which means that no speed cap is set.enableRouteHandle-A flag that indicates whether the resulting route should contain a
RouteHandle. Defaults tofalse. Note that aRouteHandlegenerated by the onlineRoutingEngineis not compatible with theOfflineRoutingEngineand vice versa.trafficOptimizationMode-The traffic optimization mode to be used for route calculation. By default, it is
TrafficOptimizationMode.TIME_DEPENDENT, which enables traffic-aware routing.enableTolls-A flag that indicates whether the resulting route
Section.getTolls()properties should contain tolls data. Defaults tofalse.Note: When a route calculation request asks tolls, a pricing scheme with higher rates might be applied. Consult your HERE representative to get more information on the related pricing schemes.
Note: For users of the
OfflineRoutingEnginethis is a beta release of this feature, so there could be a few bugs and unexpected behaviors. TheOfflineRoutingEngineis available for editions such as the Navigate Edition. For users of theRoutingEnginethe feature is stable.optimizeWaypointsOrder-A flag that indicates whether the order of waypoints that is passed to
calculateRoute()should be optimized in the best order. The best order is calculated by the same metrics that are used during regular calculation, e.g.OptimizationMode. The starting and destinationWaypointare not reordered. If the whole number of waypoints is fewer than 4 - the flag doesn't affect the resulting route (nothing to optimize). The resulting order of waypoints can be identified by their waypoint indices in the route sections (seeRoute.getSections(),Section.getDeparturePlace(),Section.getArrivalPlace(),RoutePlace.waypointIndex). Currently, the waypoints order optimization is available only when using theOfflineRoutingEngine(not available for all editions). Defaults tofalse.
-
RouteOptions
public RouteOptions(@NonNull OptimizationMode optimizationMode, int alternatives, @Nullable java.util.Date departureTime, @Nullable java.util.Date arrivalTime, @Nullable java.lang.Double speedCapInMetersPerSecond, boolean enableRouteHandle, @NonNull TrafficOptimizationMode trafficOptimizationMode, boolean enableTolls, boolean optimizeWaypointsOrder, boolean enableRouteLabels)Creates a new instance.
- Parameters:
optimizationMode-The optimization mode to be used for route calculation. By default, it is
OptimizationMode.FASTEST.alternatives-Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
departureTime-Optional time when travel is expected to start. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, i.e. now. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both departure time and
arrivalTimecannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both departure time and
arrivalTime-Optional time when travel is expected to end. Traffic speed and incidents shall be taken into account in the calculation of the route, per
trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, to predict the arrival time. Therefore, by default, a time-aware route request is initiated including traffic.Note:
- Both
departureTimeand arrival time cannot be set at the same time. - This parameter is handled as local time. Therefore, it is necessary to specify the time zone offset when setting the time in areas with different time zones, i.e. 2025-02-04T08:00:00+07:00
- Both
speedCapInMetersPerSecond-Specifies the maximum speed in meters per second, which the user wishes not to exceed. The valid range is [1, 70] meters per second. Note that it is valid only for
TransportMode.CAR,TransportMode.TRUCKandTransportMode.SCOOTERtransport modes. For car, truck and scooter transport modes, it will affectRoute.getDuration()of the route. Only for scooter transport mode, it may affect the route geometry. Defaults tonull, which means that no speed cap is set.enableRouteHandle-A flag that indicates whether the resulting route should contain a
RouteHandle. Defaults tofalse. Note that aRouteHandlegenerated by the onlineRoutingEngineis not compatible with theOfflineRoutingEngineand vice versa.trafficOptimizationMode-The traffic optimization mode to be used for route calculation. By default, it is
TrafficOptimizationMode.TIME_DEPENDENT, which enables traffic-aware routing.enableTolls-A flag that indicates whether the resulting route
Section.getTolls()properties should contain tolls data. Defaults tofalse.Note: When a route calculation request asks tolls, a pricing scheme with higher rates might be applied. Consult your HERE representative to get more information on the related pricing schemes.
Note: For users of the
OfflineRoutingEnginethis is a beta release of this feature, so there could be a few bugs and unexpected behaviors. TheOfflineRoutingEngineis available for editions such as the Navigate Edition. For users of theRoutingEnginethe feature is stable.optimizeWaypointsOrder-A flag that indicates whether the order of waypoints that is passed to
calculateRoute()should be optimized in the best order. The best order is calculated by the same metrics that are used during regular calculation, e.g.OptimizationMode. The starting and destinationWaypointare not reordered. If the whole number of waypoints is fewer than 4 - the flag doesn't affect the resulting route (nothing to optimize). The resulting order of waypoints can be identified by their waypoint indices in the route sections (seeRoute.getSections(),Section.getDeparturePlace(),Section.getArrivalPlace(),RoutePlace.waypointIndex). Currently, the waypoints order optimization is available only when using theOfflineRoutingEngine(not available for all editions). Defaults tofalse.enableRouteLabels-Specifies whether route labels should be included in the route response. Route labels identify major highways or road names along the route. By default, this is set to
false.
-
-