Interface RoutingInterface

  • All Known Implementing Classes:
    RoutingEngine

    public interface RoutingInterface

    Provides the interface for the online and offline routing engines.

    Note: Clients need to explicitly call dispose() in order to prevent a possible, though unlikely, deadlock on destruction.

    • Method Detail

      • calculateRoute

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.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. Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.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

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.List<Waypoint> waypoints,
                                  @NonNull
                                  CarOptions carOptions,
                                  @NonNull
                                  CalculateRouteCallback callback)

        Asynchronously calculates a car route from one point to another, passing through the given waypoints in the given order.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.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

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.List<Waypoint> waypoints,
                                  @NonNull
                                  PedestrianOptions pedestrianOptions,
                                  @NonNull
                                  CalculateRouteCallback callback)

        Asynchronously calculates a pedestrian route from one point to another, passing through the given waypoints in the given order.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.STOPOVER.

        pedestrianOptions -

        Options specific for pedestrian route calculation, along with common route options. Note that OptimizationMode.SHORTEST is is not supported for pedestrians and converted to OptimizationMode.FASTEST automatically.

        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

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.List<Waypoint> waypoints,
                                  @NonNull
                                  TruckOptions truckOptions,
                                  @NonNull
                                  CalculateRouteCallback callback)

        Asynchronously calculates a truck route from one point to another, passing through the given waypoints in the given order.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.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

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.List<Waypoint> waypoints,
                                  @NonNull
                                  ScooterOptions scooterOptions,
                                  @NonNull
                                  CalculateRouteCallback callback)

        Asynchronously calculates a scooter route from one point to another, passing through the given waypoints in the given order.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.STOPOVER.

        scooterOptions -

        Options specific for scooter route calculation, along with common route options. Note that OptimizationMode.SHORTEST is is not supported for scooters and converted to OptimizationMode.FASTEST automatically.

        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

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.List<Waypoint> waypoints,
                                  @NonNull
                                  BicycleOptions bicycleOptions,
                                  @NonNull
                                  CalculateRouteCallback callback)

        Asynchronously calculates a bicycle route from one point to another, passing through the given waypoints in the given order.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.STOPOVER.

        bicycleOptions -

        Options specific for bicycle route calculation, along with common route options. Note that OptimizationMode.SHORTEST is is not supported for bicycles and converted to OptimizationMode.FASTEST automatically.

        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

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.List<Waypoint> waypoints,
                                  @NonNull
                                  TaxiOptions taxiOptions,
                                  @NonNull
                                  CalculateRouteCallback callback)

        Asynchronously calculates a taxi route from one point to another, passing through the given waypoints in the given order.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.STOPOVER.

        taxiOptions -

        Options specific for taxi route calculation, along with common route options. Note that OptimizationMode.SHORTEST is is not supported for taxis and converted to OptimizationMode.FASTEST automatically.

        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

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.List<Waypoint> waypoints,
                                  @NonNull
                                  EVCarOptions evCarOptions,
                                  @NonNull
                                  CalculateRouteCallback callback)

        Asynchronously calculates an electric car route from one point to another, passing through the given waypoints in the given order.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.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

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.List<Waypoint> waypoints,
                                  @NonNull
                                  EVTruckOptions evTruckOptions,
                                  @NonNull
                                  CalculateRouteCallback callback)

        Asynchronously calculates an electic truck route from one point to another, passing through the given waypoints in the given order.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.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

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.List<Waypoint> waypoints,
                                  @NonNull
                                  BusOptions busOptions,
                                  @NonNull
                                  CalculateRouteCallback callback)

        Asynchronously calculates a bus route from one point to another, passing through the given waypoints in the given order.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.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

        @NonNull
        TaskHandle calculateRoute​(@NonNull
                                  java.util.List<Waypoint> waypoints,
                                  @NonNull
                                  PrivateBusOptions privateBusOptions,
                                  @NonNull
                                  CalculateRouteCallback callback)

        Asynchronously calculates a private bus route from one point to another, passing through the given waypoints in the given order.

        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_PARAMETER error is generated when the waypoint list contains less than two elements or when the first and the last waypoints are not of type WaypointType.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
        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, and RouteOptions.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 RouteDeviation events 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.lastLocationOnRoute is 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.

        Parameters:
        route -

        A Route calculated using the online or offline route engine. For the offline case, It should not contain an indoor Section as such routes will fail. For the online case, it should have RouteHandle.

        startingPoint -

        The current location, for example, provided by a RouteDeviation event. The waypoint needs to be of type WaypointType.STOPOVER. Otherwise, an RoutingError.INVALID_PARAMETER error 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

        void dispose()

        Cancels pending requests and closes the background worker thread. Note: This method should be called from main thread.