Class TransitRoutingEngine
- Last UpdatedMay 13, 2025
- 2 minute read
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.routing.TransitRoutingEngine
-
public final class TransitRoutingEngine extends NativeBase
Use the TransitRoutingEngine to calculate a public transit 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.
-
-
Constructor Summary
Constructors Constructor Description TransitRoutingEngine()
Creates a new instance of this class.TransitRoutingEngine(SDKNativeEngine sdkEngine)
Creates a new instance of TransitRoutingEngine.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskHandle
calculateRoute(TransitWaypoint startingPoint, TransitWaypoint destination, TransitRouteOptions routeOptions, CalculateRouteCallback callback)
Asynchronously calculates a public transit route from the origin to the destination.
-
-
-
Constructor Detail
-
TransitRoutingEngine
public TransitRoutingEngine() throws InstantiationErrorException
Creates a new instance of this class.
- Throws:
InstantiationErrorException
-Indicates what went wrong when the instantiation was attempted.
-
TransitRoutingEngine
public TransitRoutingEngine(@NonNull SDKNativeEngine sdkEngine) throws InstantiationErrorException
Creates a new instance of TransitRoutingEngine.
- Parameters:
sdkEngine
-An SDKEngine instance.
- Throws:
InstantiationErrorException
-Indicates what went wrong when the instantiation was attempted.
-
-
Method Detail
-
calculateRoute
@NonNull public TaskHandle calculateRoute(@NonNull TransitWaypoint startingPoint, @NonNull TransitWaypoint destination, @NonNull TransitRouteOptions routeOptions, @NonNull CalculateRouteCallback callback)
Asynchronously calculates a public transit route from the origin to the destination.
- Parameters:
startingPoint
-Position of starting point.
destination
-Position of destination.
routeOptions
-Options for public transit route calculation.
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.
-
-