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.
|
List<? extends Bearing> |
getCluster(GeoPoint center,
double searchRadiusInMeters,
int routeSnappingRadius,
MapPointsTree<com.inrix.sdk.RouteTracker.RouteIncidentPoint> tree)
Get incidents cluster within specified radius.
|
List<DangerousSlowdown> |
getDangerousSlowdownCluster(GeoPoint center,
double searchRadiusInMeters) |
Integer |
getDistanceRemaining(GeoPoint location,
Float locationAccuracy)
Get the distance remaining in meters from the given location to the end of the route.
|
SimpleArrayMap<DangerousSlowdown,Double> |
getDSlowdownsWithDistanceFromOrigin() |
List<Incident> |
getIncidentsCluster(GeoPoint center,
double searchRadiusInMeters)
Get incidents cluster within specified radius.
|
SimpleArrayMap<Incident,Double> |
getIncidentsWithDistanceFromOrigin() |
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> getIncidentsCluster(@NonNull GeoPoint center, double searchRadiusInMeters)
center
- The central to find incidents around.searchRadiusInMeters
- The incident search radius in meters.Incident
.public List<DangerousSlowdown> getDangerousSlowdownCluster(@NonNull GeoPoint center, double searchRadiusInMeters)
public List<? extends Bearing> getCluster(@NonNull GeoPoint center, double searchRadiusInMeters, int routeSnappingRadius, MapPointsTree<com.inrix.sdk.RouteTracker.RouteIncidentPoint> tree)
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()
public SimpleArrayMap<DangerousSlowdown,Double> getDSlowdownsWithDistanceFromOrigin()
Copyright © 2013-2018 INRIX, Inc. All Rights Reserved.