public class RouteTracker extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ON_ROUTE_TOLERANCE_DEFAULT_METERS
Default threshold for considering a user "on route".
|
| Constructor and Description |
|---|
RouteTracker()
Initialize a
RouteTracker instance with the default "on route" tolerance. |
RouteTracker(int onRouteTolerance)
Initialize a
RouteTracker instance with the provided "on route" tolerance in meters. |
| Modifier and Type | Method and Description |
|---|---|
com.inrix.sdk.RouteTracker.RoutePoint |
findClosestRoutePoint(GeoPoint location,
Float locationAccuracy)
Get the closest route point from the given location to the end of the route.
|
Integer |
getDistanceRemaining(GeoPoint location,
Float locationAccuracy)
Get the distance remaining in meters from the given location to the end of the route.
|
List<Incident> |
getIncidentCluster(GeoPoint center,
double searchRadiusInMeters)
Get incidents cluster within specified radius.
|
List<Incident> |
getIncidentCluster(GeoPoint center,
double searchRadiusInMeters,
int routeSnappingRadius)
Get incidents cluster within specified radius.
|
SimpleArrayMap<Incident,Double> |
getIncidentsWithDistanceFromOrigin()
Gets a map of
Incident to distance set to the driving distance from origin. |
Integer |
getTotalRouteDistance()
Get the total route distance in meters.
|
boolean |
isOnRoute(GeoPoint location,
Float locationAccuracy)
Given current location check if this location is along the route.
|
void |
setRoute(Route route)
Set the route to track.
|
public static final int ON_ROUTE_TOLERANCE_DEFAULT_METERS
public RouteTracker()
RouteTracker instance with the default "on route" tolerance.public RouteTracker(int onRouteTolerance)
RouteTracker instance with the provided "on route" tolerance in meters.onRouteTolerance - The distance in meters that is considered "on route".@WorkerThread public void setRoute(Route route)
route - The route to track or null to clear the route.public boolean isOnRoute(@NonNull GeoPoint location, Float locationAccuracy)
location - The location.locationAccuracy - The accuracy of the provided location in meters.true if on route, otherwise false.public List<Incident> getIncidentCluster(@NonNull GeoPoint center, double searchRadiusInMeters)
center - The central to find incidents around.searchRadiusInMeters - The incident search radius in meters.Incident.public List<Incident> getIncidentCluster(@NonNull GeoPoint center, double searchRadiusInMeters, int routeSnappingRadius)
center - The central to find incidents around.searchRadiusInMeters - The incident search radius in meters.routeSnappingRadius - The max allowed distance between the location from the route.Incident.public Integer getTotalRouteDistance()
public Integer getDistanceRemaining(@NonNull GeoPoint location, Float locationAccuracy)
location - The location to get the distance remaining.locationAccuracy - The accuracy of the provided location in meters.public com.inrix.sdk.RouteTracker.RoutePoint findClosestRoutePoint(@NonNull GeoPoint location, Float locationAccuracy)
location - The location to get the closest point.locationAccuracy - The accuracy of the provided location in meters.null if not on the route.public SimpleArrayMap<Incident,Double> getIncidentsWithDistanceFromOrigin()
Incident to distance set to the driving distance from origin.
For congestion, distance calculated using Incident.getHead(), for all other incidents Incident.getLocation().Incident and distances from origin.Copyright © 2013-2016 INRIX, Inc. All Rights Reserved.