RoutingEngine (API Reference)
Class RoutingEngine
- All Implemented Interfaces:
RoutingInterface
Use the RoutingEngine to calculate a route from A to B with a number of waypoints in between.
Route calculation is done asynchronously and requires an online connection. The resulting route contains various information such as the polyline, route length in meters, estimated time to traverse along the route and maneuver data.
Note: The engine does not support an unlimited number of waypoints.
The limit is defined by the HERE backend services and may change. For now,
the maximum number of waypoints should be below 200. This value may change
and it is not guaranteed to be stable. If you need to support very large lists
of waypoints, consider to import a route (see importRoute() method) or use
the OfflineRoutingEngine which supports an unlimited number of waypoints.
The OfflineRoutingEngine is only available for Navigate licence.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of this class.RoutingEngine(SDKNativeEngine sdkEngine) Creates a new instance of RoutingEngine.RoutingEngine(SDKNativeEngine sdkEngine, RoutingConnectionSettings connectionSettings) Creates a new instance of RoutingEngine.RoutingEngine(RoutingConnectionSettings connectionSettings) Creates a new instance of RoutingEngine. -
Method Summary
Modifier and TypeMethodDescriptioncalculateRoute(List<Waypoint> waypoints, BicycleOptions bicycleOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.calculateRoute(List<Waypoint> waypoints, BusOptions busOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.calculateRoute(List<Waypoint> waypoints, CarOptions carOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.calculateRoute(List<Waypoint> waypoints, EVCarOptions evCarOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.calculateRoute(List<Waypoint> waypoints, EVTruckOptions evTruckOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.calculateRoute(List<Waypoint> waypoints, PedestrianOptions pedestrianOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.calculateRoute(List<Waypoint> waypoints, PrivateBusOptions privateBusOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.calculateRoute(List<Waypoint> waypoints, RoutingOptions options, CalculateRouteCallback callback) Asynchronously calculates a route from one point to another, passing through the given waypoints in the given order.calculateRoute(List<Waypoint> waypoints, ScooterOptions scooterOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.calculateRoute(List<Waypoint> waypoints, TaxiOptions taxiOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.calculateRoute(List<Waypoint> waypoints, TruckOptions truckOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.calculateTrafficOnRoute(Route route, int lastTraveledSectionIndex, int traveledDistanceOnLastSectionInMeters, double currentChargeInKilowattHours, CalculateTrafficOnRouteCallback callback) Asynchronously calculates the traffic along an EV car route starting from the index of the last traveled route section and an offset in meters from the last visited position on the section.calculateTrafficOnRoute(Route route, int lastTraveledSectionIndex, int traveledDistanceOnLastSectionInMeters, CalculateTrafficOnRouteCallback callback) Asynchronously calculates the traffic along a route starting from the index of the last traveled route section and an offset (in meters) from the last visited position on the section.voiddispose()Cancels pending requests and closes the background worker thread.importRoute(RouteHandle routeHandle, RefreshRouteOptions refreshRouteOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(RouteHandle routeHandle, RoutingOptions options, CalculateRouteCallback callback) Asynchronously recreates a route from theRouteHandleprovided, i.e.importRoute(List<Location> locations, BicycleOptions bicycleOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, BusOptions busOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, CarOptions carOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, EVCarOptions evCarOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, EVTruckOptions evTruckOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, PedestrianOptions pedestrianOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, PrivateBusOptions privateBusOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, RoutingOptions options, CalculateRouteCallback callback) Asynchronously creates a route from a sequence of geographic coordinates very close to each other.importRoute(List<Location> locations, ScooterOptions scooterOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, TaxiOptions taxiOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, TruckOptions truckOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, List<RouteStop> routeStops, BicycleOptions bicycleOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, List<RouteStop> routeStops, BusOptions busOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, List<RouteStop> routeStops, CarOptions carOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, List<RouteStop> routeStops, EVCarOptions evCarOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, List<RouteStop> routeStops, EVTruckOptions evTruckOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, List<RouteStop> routeStops, PedestrianOptions pedestrianOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, List<RouteStop> routeStops, PrivateBusOptions privateBusOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, List<RouteStop> routeStops, RoutingOptions options, CalculateRouteCallback callback) Asynchronously creates a route from a sequence of geographic coordinates very close to each other.importRoute(List<Location> locations, List<RouteStop> routeStops, ScooterOptions scooterOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, List<RouteStop> routeStops, TaxiOptions taxiOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.importRoute(List<Location> locations, List<RouteStop> routeStops, TruckOptions truckOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.refreshRoute(RouteHandle routeHandle, Waypoint startingPoint, RefreshRouteOptions refreshRouteOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.refreshRoute(RouteHandle routeHandle, Waypoint startingPoint, RoutingOptions options, CalculateRouteCallback callback) Asynchronously refreshes a previously calculated route from the providedRouteHandle, updating the starting point and route metadata based onRoutingOptions.refreshRoute(RouteHandle routeHandle, Waypoint startingPoint, Integer lastTraveledSectionIndex, Integer traveledDistanceOnLastSectionInMeters, RefreshRouteOptions refreshRouteOptions, CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0.refreshRoute(RouteHandle routeHandle, Waypoint startingPoint, Integer lastTraveledSectionIndex, Integer traveledDistanceOnLastSectionInMeters, RoutingOptions options, CalculateRouteCallback callback) Asynchronously refreshes a previously calculated route from the providedRouteHandle, updating the starting point and route metadata based onRoutingOptions.returnToRoute(Route route, Waypoint startingPoint, int lastTraveledSectionIndex, int traveledDistanceOnLastSectionInMeters, CalculateRouteCallback callback) Asynchronously calculates a new route that leads back to the original route.setCustomOption(String name, String value) Sets a custom option for routing backend queries.
-
Constructor Details
-
RoutingEngine
Creates a new instance of this class.
- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
RoutingEngine
Creates a new instance of RoutingEngine.
- Parameters:
sdkEngine-An SDKEngine instance.
- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
RoutingEngine
public RoutingEngine(@NonNull RoutingConnectionSettings connectionSettings) throws InstantiationErrorException Creates a new instance of RoutingEngine.
- Parameters:
connectionSettings-Settings for the route calculation.
- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
RoutingEngine
public RoutingEngine(@NonNull SDKNativeEngine sdkEngine, @NonNull RoutingConnectionSettings connectionSettings) throws InstantiationErrorException Creates a new instance of RoutingEngine.
- Parameters:
sdkEngine-An SDKEngine instance.
connectionSettings-Settings for the route calculation.
- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
-
Method Details
-
refreshRoute
@Deprecated @NonNull public TaskHandle refreshRoute(@NonNull RouteHandle routeHandle, @NonNull Waypoint startingPoint, @NonNull RefreshRouteOptions refreshRouteOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
refresh_route()methods with RoutingOptions parameter instead.Asynchronously refreshes a previously calculated route from the provided
RouteHandle, updating the starting point and route metadata based onRefreshRouteOptions. The route shape from the new starting point to the destination remains unchanged, and only metadata such as arrival time and traffic delays are updated. If you only want to refresh the contained traffic information or retrieve updated ETA duration, consider usingcalculateTrafficOnRoute(Route, int, int, double, CalculateTrafficOnRouteCallback)instead.Calling this method will trigger a new "HERE Routing" transaction, for example, if you are using the Base Plan.
- Parameters:
routeHandle-The route handle holding the route to be refreshed.
startingPoint-Updates the starting point of the route. It should be of type
WaypointType.STOPOVER. Otherwise, anRoutingError.INVALID_PARAMETERerror is generated. Moreover, it should be very close to the original route specified with theRouteHandle. Since the new starting point is expected to be along the original route, the original route geometry is used to reach the remaining waypoints. The new route will not include theWaypointitems that lie behind the new starting point (i.e. the path that was already travelled). Plus,Route.getLengthInMeters()andRoute.getDuration()values are from the new starting point to the destination. If the new waypoint is too far off the original route, the route refresh may fail and anRoutingError.COULD_NOT_MATCH_ORIGINerror is triggered. In that case, an application may decide to calculate a new route from scratch.refreshRouteOptions-Options to refresh the route.
callback-Callback object that will be invoked after refreshing the route. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
refreshRoute
@Deprecated @NonNull public TaskHandle refreshRoute(@NonNull RouteHandle routeHandle, @Nullable Waypoint startingPoint, @Nullable Integer lastTraveledSectionIndex, @Nullable Integer traveledDistanceOnLastSectionInMeters, @NonNull RefreshRouteOptions refreshRouteOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
refresh_route()methods with RoutingOptions parameter instead.Asynchronously refreshes a previously calculated route from the provided
RouteHandle, updating the starting point and route metadata based onRefreshRouteOptions. The route shape from the new starting point to the destination remains unchanged, and only metadata such as arrival time and traffic delays are updated. If you only want to refresh the contained traffic information, consider to usecalculateTrafficOnRoute(Route, int, int, double, CalculateTrafficOnRouteCallback)instead.Calling this method will trigger a new "HERE Routing" transaction, for example, if you are using the Base Plan.
- Parameters:
routeHandle-The route handle holding the route to be refreshed.
startingPoint-Updates the starting point of the route. It should be of type
WaypointType.STOPOVER. Otherwise, anRoutingError.INVALID_PARAMETERerror is generated. Moreover, it should be very close to the original route specified with theRouteHandle. Since the new starting point is expected to be along the original route, the original route geometry is used to reach the remaining waypoints. The new route will not include theWaypointitems that lie behind the new starting point (i.e. the path that was already travelled). Plus,Route.getLengthInMeters()andRoute.getDuration()values are from the new starting point to the destination. If the new waypoint is too far off the original route, the route refresh may fail and anRoutingError.COULD_NOT_MATCH_ORIGINerror is triggered. In that case, an application may decide to calculate a new route from scratch.lastTraveledSectionIndex-Indicates the index of the last traveled route section. Traveled part of the route won't be reused.
traveledDistanceOnLastSectionInMeters-Offset in meter to the last visited position on the route section defined by the last traveled section index.
refreshRouteOptions-Options to refresh the route.
callback-Callback object that will be invoked after refreshing the route. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
refreshRoute
@NonNull public TaskHandle refreshRoute(@NonNull RouteHandle routeHandle, @Nullable Waypoint startingPoint, @Nullable Integer lastTraveledSectionIndex, @Nullable Integer traveledDistanceOnLastSectionInMeters, @NonNull RoutingOptions options, @NonNull CalculateRouteCallback callback) Asynchronously refreshes a previously calculated route from the provided
RouteHandle, updating the starting point and route metadata based onRoutingOptions. The route shape from the new starting point to the destination remains unchanged, and only metadata such as arrival time and traffic delays are updated. If you only want to refresh the contained traffic information, consider to usecalculateTrafficOnRoute(Route, int, int, double, CalculateTrafficOnRouteCallback)instead.Calling this method will trigger a new "HERE Routing" transaction, for example, if you are using the Base Plan.
- Parameters:
routeHandle-The route handle holding the route to be refreshed.
startingPoint-Updates the starting point of the route. It should be of type
WaypointType.STOPOVER. Otherwise, anRoutingError.INVALID_PARAMETERerror is generated. Moreover, it should be very close to the original route specified with theRouteHandle. Since the new starting point is expected to be along the original route, the original route geometry is used to reach the remaining waypoints. The new route will not include theWaypointitems that lie behind the new starting point (i.e. the path that was already traveled). Plus,Route.getLengthInMeters()andRoute.getDuration()values are from the new starting point to the destination. If the new waypoint is too far off the original route, the route refresh may fail and anRoutingError.COULD_NOT_MATCH_ORIGINerror is triggered. In that case, an application may decide to calculate a new route from scratch.lastTraveledSectionIndex-Indicates the index of the last traveled route section. Traveled part of the route won't be reused.
traveledDistanceOnLastSectionInMeters-Offset in meter to the last visited position on the route section defined by the last traveled section index.
options-The options define the vehicle and route options to calculate the route.
callback-Callback object that will be invoked after refreshing the route. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
refreshRoute
@NonNull public TaskHandle refreshRoute(@NonNull RouteHandle routeHandle, @NonNull Waypoint startingPoint, @NonNull RoutingOptions options, @NonNull CalculateRouteCallback callback) Asynchronously refreshes a previously calculated route from the provided
RouteHandle, updating the starting point and route metadata based onRoutingOptions. The route shape from the new starting point to the destination remains unchanged, and only metadata such as arrival time and traffic delays are updated. If you only want to refresh the contained traffic information, consider to usecalculateTrafficOnRoute(Route, int, int, double, CalculateTrafficOnRouteCallback)instead.Calling this method will trigger a new "HERE Routing" transaction, for example, if you are using the Base Plan.
- Parameters:
routeHandle-The route handle holding the route to be refreshed.
startingPoint-Updates the starting point of the route. It should be of type
WaypointType.STOPOVER. Otherwise, anRoutingError.INVALID_PARAMETERerror is generated. Moreover, it should be very close to the original route specified with theRouteHandle. Since the new starting point is expected to be along the original route, the original route geometry is used to reach the remaining waypoints. The new route will not include theWaypointitems that lie behind the new starting point (i.e. the path that was already traveled). Plus,Route.getLengthInMeters()andRoute.getDuration()values are from the new starting point to the destination. If the new waypoint is too far off the original route, the route refresh may fail and anRoutingError.COULD_NOT_MATCH_ORIGINerror is triggered. In that case, an application may decide to calculate a new route from scratch.options-The options define the vehicle and route options to calculate the route.
callback-Callback object that will be invoked after refreshing the route. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull RouteHandle routeHandle, @NonNull RefreshRouteOptions refreshRouteOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously recreates a route from the
RouteHandleprovided, i.e. refreshes a previously calculated route, with the specifiedRefreshRouteOptions.A route handle can be invalid when the map data changes that is used by the HERE backend to recreate the route. This happens regularly. Therefore, the route handle is not meant to be persisted for a longer time. Instead, a possible use case can be to plan a route with another HERE service. For example, a HERE REST API that allows to calculate a route on a desktop. Then this route can be transferred via the handle to a mobile device for further use with the HERE SDK.
- Parameters:
routeHandle-The route handle holding the route to be refreshed.
refreshRouteOptions-The options define the vehicle and route options to calculate the route. Note An [sdk.routing.RoutingError.INVALID_PARAMETER] is generated when the [sdk.routing.ElectricVehicleOptions.ensure_reachability] option is set to
true.callback-Callback object that will be invoked after refreshing the route. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull CarOptions carOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a car route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].carOptions-Options specific for car route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull PedestrianOptions pedestrianOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a pedestrian route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.pedestrianOptions-Options specific for pedestrian route calculation, along with common route options. Note that
OptimizationMode.SHORTESTis not supported for pedestrians and converted toOptimizationMode.FASTESTautomatically.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull BicycleOptions bicycleOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a bicycle route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.bicycleOptions-Options specific for bicycle route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull ScooterOptions scooterOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a scooter route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.scooterOptions-Options specific for scooter route calculation, along with common route options. Note that
OptimizationMode.SHORTESTis not supported for scooters and converted toOptimizationMode.FASTESTautomatically.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull PedestrianOptions pedestrianOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a pedestrian route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].pedestrianOptions-Options specific for pedestrian route calculation, along with common route options. Note that
OptimizationMode.SHORTESTis not supported for pedestrians and converted toOptimizationMode.FASTESTautomatically.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull BicycleOptions bicycleOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a bicycle route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].bicycleOptions-Options specific for bicycle route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull ScooterOptions scooterOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a scooter route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].scooterOptions-Options specific for scooter route calculation, along with common route options. Note that
OptimizationMode.SHORTESTis not supported for scooters and converted toOptimizationMode.FASTESTautomatically.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull TruckOptions truckOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a truck route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].truckOptions-Options specific for truck route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull TaxiOptions taxiOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a taxi route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].taxiOptions-Options specific for taxi route calculation, along with common route options. Note that
OptimizationMode.SHORTESTis not supported for taxis and converted toOptimizationMode.FASTESTautomatically.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull BusOptions busOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a bus route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].busOptions-Options specific for bus route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull PrivateBusOptions privateBusOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a private bus route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or anyway geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].privateBusOptions-Options specific for private bus route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull EVCarOptions evCarOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates an electric car route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].evCarOptions-Options specific for an electric car route calculation, along with common route options. Note An [sdk.routing.RoutingError.INVALID_PARAMETER] is generated when the [sdk.routing.EVCarOptions.ensure_reachability] option is set to
true.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull EVTruckOptions evTruckOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates an electric truck route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].evTruckOptions-Options specific for an electric truck route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull CarOptions carOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a car route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.carOptions-Options specific for car route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull TruckOptions truckOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a truck route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.truckOptions-Options specific for truck route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull TaxiOptions taxiOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a taxi route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.taxiOptions-Options specific for taxi route calculation, along with common route options. Note that
OptimizationMode.SHORTESTis not supported for taxis and converted toOptimizationMode.FASTESTautomatically.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull BusOptions busOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a bus route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.busOptions-Options specific for bus route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull PrivateBusOptions privateBusOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates a private bus route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or anyway geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.privateBusOptions-Options specific for private bus route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull EVCarOptions evCarOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates an electric car route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.evCarOptions-Options specific for an electric car route calculation, along with common route options. Note An [sdk.routing.RoutingError.INVALID_PARAMETER] is generated when the [sdk.routing.EVCarOptions.ensure_reachability] option is set to
true.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@Deprecated @NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull EVTruckOptions evTruckOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
import_route()methods with RoutingOptions parameter instead.Asynchronously creates an electric truck route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.evTruckOptions-Options specific for an electric truck route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull RoutingOptions options, @NonNull CalculateRouteCallback callback) Asynchronously creates a route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].options-The options define the vehicle and route options to calculate the route.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@NonNull public TaskHandle importRoute(@NonNull List<Location> locations, @NonNull List<RouteStop> routeStops, @NonNull RoutingOptions options, @NonNull CalculateRouteCallback callback) Asynchronously creates a route from a sequence of geographic coordinates very close to each other. The route shape will be kept as close as possible to the one provided. For best results please use 1Hz GPS data, or geographic coordinates that have a spacing of a few meters one from the other. For example, such a list of geographic coordinates can be extracted from a GPX trace or a route object from a 3rd party library. Very sparse data may be rejected by the service with an error.
Note: Any restrictions applied to a transport type or provided options will be discarded and reported as violations in
Section.getSectionNotices().- Parameters:
locations-The list of locations used to calculate the route. Note that only the
Location.coordinatesof a location are used to import the route.An
RoutingError.INVALID_PARAMETERerror is generated when the location list size is not in the range [2,50000].routeStops-The list of RouteStop's which contains index of location from locations list used for route stop and duration in seconds spent on stop.
An
RoutingError.INVALID_PARAMETERerror is generated when the route stops list size is not in the range [1,locations.size()-2], any of location_index is < 1 or location_indexes are not unique.options-The options define the vehicle and route options to calculate the route.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
importRoute
@NonNull public TaskHandle importRoute(@NonNull RouteHandle routeHandle, @NonNull RoutingOptions options, @NonNull CalculateRouteCallback callback) Asynchronously recreates a route from the
RouteHandleprovided, i.e. refreshes a previously calculated route, with the specifiedRoutingOptions.A route handle can be invalid when the map data changes that is used by the HERE sdk to recreate the route. This happens regularly. Therefore, the route handle is not meant to be persisted for a longer time.
- Parameters:
routeHandle-The route handle holding the route to be refreshed.
options-The options define the vehicle and route options to calculate the route.
callback-Callback object that will be invoked after refreshing the route. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateTrafficOnRoute
@NonNull public TaskHandle calculateTrafficOnRoute(@NonNull Route route, int lastTraveledSectionIndex, int traveledDistanceOnLastSectionInMeters, @NonNull CalculateTrafficOnRouteCallback callback) Asynchronously calculates the traffic along a route starting from the index of the last traveled route section and an offset (in meters) from the last visited position on the section. Call this when only the contained traffic information or the latest ETA duration is needed. This can be called periodically to retrieve updated ETA values during navigation.
Note: Calling this method will trigger a new "HERE Traffic" transaction, for example, if you are using the Base Plan.
- Parameters:
route-A
Routecalculated using the online routing engine. ItsRouteHandleand the original route calculation options will be used to compute the traffic on the route. The original route remains untouched.lastTraveledSectionIndex-Indicates the index of the last traveled route section. Traveled part of the route won't be reused.
traveledDistanceOnLastSectionInMeters-Offset, in meters, to the last visited position on the route section defined by the last traveled section index.
callback-Callback object that will be invoked after route traffic has been calculated. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateTrafficOnRoute
@NonNull public TaskHandle calculateTrafficOnRoute(@NonNull Route route, int lastTraveledSectionIndex, int traveledDistanceOnLastSectionInMeters, double currentChargeInKilowattHours, @NonNull CalculateTrafficOnRouteCallback callback) Asynchronously calculates the traffic along an EV car route starting from the index of the last traveled route section and an offset in meters from the last visited position on the section. The field
TrafficOnSpan.consumptionInKilowattHourswill contain the power consumption in kilowatt-hours (kWh) necessary to traverse the span, andRoutePlace.chargeInKilowattHours, insideTrafficOnSection.departurePlaceandTrafficOnSection.arrivalPlace, the estimated battery charge in kilowatt-hours (kWh) when leaving/arriving to a section. Note: Only EV cars are supported.- Parameters:
route-A
Routecalculated using the online routing engine. ItsRouteHandleand the original route calculation options, along with EV related information likeBatterySpecifications, will be used to compute the traffic on the route. The original route remains untouched.lastTraveledSectionIndex-Indicates the index of the last traveled route section. Traveled part of the route won't be reused.
traveledDistanceOnLastSectionInMeters-Offset, in meters, to the last visited position on the route section defined by the last traveled section index.
currentChargeInKilowattHours-Charge level of the vehicle's battery at the current location (in kWh). It must be non-negative and less than or equal to the value of
BatterySpecifications.totalCapacityInKilowattHours, otherwise theBatterySpecificationsinstance is considered invalid. SetsBatterySpecifications.initialChargeInKilowattHoursto the given value.callback-Callback object that will be invoked after route traffic has been calculated. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
setCustomOption
Sets a custom option for routing backend queries. The custom option is applied to all the queries that
RoutingEngineperforms. For a complete list of available parameter names and their valid values, refer to HERE Routing API v8. Note: It's easy to set a wrong option that makes queries invalid, so make sure you read and understand the backend documentation.- Parameters:
name-An option name. If the engine already has an option with the same name, the option will be overwritten. The option name must be a non-empty string.
value-An option value. If the value is
null, the option will be removed. The option value must be a non-empty string.- Returns:
An optional error of setting the option. It's
nullif the option has been set successfully. It'sRoutingError.INVALID_PARAMETERif the input name and/or value haven't passed internal validation.
-
calculateRoute
@NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull RoutingOptions options, @NonNull CalculateRouteCallback callback) Asynchronously calculates a route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.options-Options describing routing options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateRoute
@Deprecated @NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull CarOptions carOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
calculate_route()methods with RoutingOptions parameter instead.Asynchronously calculates a car route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.carOptions-Options specific for car route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateRoute
@Deprecated @NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull PedestrianOptions pedestrianOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
calculate_route()methods with RoutingOptions parameter instead.Asynchronously calculates a pedestrian route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.pedestrianOptions-Options specific for pedestrian route calculation, along with common route options. Note that
OptimizationMode.SHORTESTis is not supported for pedestrians and converted toOptimizationMode.FASTESTautomatically.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateRoute
@Deprecated @NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull TruckOptions truckOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
calculate_route()methods with RoutingOptions parameter instead.Asynchronously calculates a truck route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.truckOptions-Options specific for truck route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateRoute
@Deprecated @NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull ScooterOptions scooterOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
calculate_route()methods with RoutingOptions parameter instead.Asynchronously calculates a scooter route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.scooterOptions-Options specific for scooter route calculation, along with common route options. Note that
OptimizationMode.SHORTESTis is not supported for scooters and converted toOptimizationMode.FASTESTautomatically.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateRoute
@Deprecated @NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull BicycleOptions bicycleOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
calculate_route()methods with RoutingOptions parameter instead.Asynchronously calculates a bicycle route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.bicycleOptions-Options specific for bicycle route calculation, along with common route options. Note that
OptimizationMode.SHORTESTis is not supported for bicycles and converted toOptimizationMode.FASTESTautomatically.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateRoute
@Deprecated @NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull TaxiOptions taxiOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
calculate_route()methods with RoutingOptions parameter instead.Asynchronously calculates a taxi route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.taxiOptions-Options specific for taxi route calculation, along with common route options. Note that
OptimizationMode.SHORTESTis is not supported for taxis and converted toOptimizationMode.FASTESTautomatically.callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateRoute
@Deprecated @NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull EVCarOptions evCarOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
calculate_route()methods with RoutingOptions parameter instead.Asynchronously calculates an electric car route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.evCarOptions-Options specific for an electric car route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateRoute
@Deprecated @NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull EVTruckOptions evTruckOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
calculate_route()methods with RoutingOptions parameter instead.Asynchronously calculates an electic truck route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.evTruckOptions-Options specific for an electric truck route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateRoute
@Deprecated @NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull BusOptions busOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
calculate_route()methods with RoutingOptions parameter instead.Asynchronously calculates a bus route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.busOptions-Options specific for a bus route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
calculateRoute
@Deprecated @NonNull public TaskHandle calculateRoute(@NonNull List<Waypoint> waypoints, @NonNull PrivateBusOptions privateBusOptions, @NonNull CalculateRouteCallback callback) Deprecated.Will be removed in v4.28.0. Use the
calculate_route()methods with RoutingOptions parameter instead.Asynchronously calculates a private bus route from one point to another, passing through the given waypoints in the given order.
- Specified by:
calculateRoutein interfaceRoutingInterface- Parameters:
waypoints-The list of waypoints used to calculate the route. The first element marks the starting position, the last marks the destination. Waypoints in between are interpreted as intermediate.
An
RoutingError.INVALID_PARAMETERerror is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of typeWaypointType.STOPOVER.privateBusOptions-Options specific for a private bus route calculation, along with common route options.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
returnToRoute
@NonNull public TaskHandle returnToRoute(@NonNull Route route, @NonNull Waypoint startingPoint, int lastTraveledSectionIndex, int traveledDistanceOnLastSectionInMeters, @NonNull CalculateRouteCallback callback) Asynchronously calculates a new route that leads back to the original route. The part of the original route which was already traveled by the user is ignored.
Note: Stopover waypoints are guaranteed to be visited. Pass-through waypoints will be ignored. Additionally, the following route options are ignored:
RouteOptions.alternatives,RouteOptions.arrivalTime, andRouteOptions.optimizationMode. Most route options are only applied to the newly calculated part back to the route.An application may use this method to submit a new starting point for a previously calculated route. This method tries to avoid a costly route re-calculation as much as possible. In case returning to the route without re-calculation is not possible, a new route is calculated, while trying to salvage the previous route as much as possible. However, a completely new route containing no part of the previous route is possible, too.
Note that this function uses only a limited amount of map data around the new origin. Therefore, it may also work fine with temporarily cached map data. It may also copy some of the original route data into the new route.
A typical use case is to await at least 3
RouteDeviationevents before calling this method.- Or alternatively, wait at least 10 seconds after getting the first deviation event.
- On top, the user experience can be improved by checking if the vehicle has moved at least 50 meters since calling this method for the last time.
- Optionally, it may make sense to verify if the vehicle was ever following the route by checking if
RouteDeviation.lastLocationOnRouteis set.
Note that deviation events are sent each time a deviation is detected, i.e. for each new location update, regardless if the location has changed or not. More information can be found in the Developer Guide in the "Handle route deviations" section.
- Specified by:
returnToRoutein interfaceRoutingInterface- Parameters:
route-A
Routecalculated using the online or offline route engine. For the offline case, It should not contain an indoorSectionas such routes will fail. For the online case, it should haveRouteHandle.startingPoint-The current location, for example, provided by a
RouteDeviationevent. The waypoint needs to be of typeWaypointType.STOPOVER. Otherwise, anRoutingError.INVALID_PARAMETERerror is generated.lastTraveledSectionIndex-Indicates the index of the last traveled route section. Traveled part of the route won't be reused.
traveledDistanceOnLastSectionInMeters-Offset in meter to the last visited position on the route section defined by the last traveled section index.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
dispose
public void dispose()Cancels pending requests and closes the background worker thread. Note: This method should be called from main thread.
- Specified by:
disposein interfaceRoutingInterface
-