Class ReroutingParameters
- java.lang.Object
-
- com.esri.arcgisruntime.navigation.ReroutingParameters
-
public final class ReroutingParameters extends java.lang.ObjectRepresents the parameters that are used to perform automatic re-routing if off-route while navigating along a route.This class defines how automatic re-routing calculations will be performed if off-route is detected while navigating along a route. To enable re-routing, call the
RouteTracker.enableReroutingAsync(ReroutingParameters)method passing in this class as the argument.Note that re-routing only occurs when the current location is off-route, but on or near the transportation network edges. For example if an off-route state is detected but the tracked location is in a parking lot, away from any transportation network edges, re-routing will not occur, and will occur only once a subsequent tracked location is on or near the transportation network edges.
- Since:
- 100.11.0
-
-
Constructor Summary
Constructors Constructor Description ReroutingParameters(RouteTask routeTask, RouteParameters routeParameters)Creates a Rerouting parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArcGISFeatureTablegetNetworkEdgeGeometries()Gets aArcGISFeatureTablecontaining thePolylinegeometries that theRouteTask's network is based on.RouteParametersgetRouteParameters()Gets aRouteParametersobject that defines parameters for the reroutingRouteTask.RouteTaskgetRouteTask()Gets aRouteTaskcapable of solving routes on the same network that created the original route.RouteTracker.ReroutingStrategygetStrategy()Gets a rerouting strategy that determines how new routes are created (to the next waypoint by default).booleanisVisitFirstStopOnStart()Whether the first stop must be visited when rerouted (false by default).voidsetNetworkEdgeGeometries(ArcGISFeatureTable networkEdgeGeometries)voidsetStrategy(RouteTracker.ReroutingStrategy strategy)Sets a rerouting strategy that determines how new routes are created (to the next waypoint by default).voidsetVisitFirstStopOnStart(boolean visitFirstStopOnStart)Whether the first stop must be visited when rerouted (false by default).
-
-
-
Constructor Detail
-
ReroutingParameters
public ReroutingParameters(RouteTask routeTask, RouteParameters routeParameters)
Creates a Rerouting parameters.An exception is thrown if the
RouteTaskorRouteParametersare null.- Parameters:
routeTask- aRouteTaskcapable of solving routes on the same network used by the original routerouteParameters- creates a re-routing parameters object based on aRouteTaskandRouteParameters- Throws:
java.lang.IllegalArgumentException- if routeTask is nulljava.lang.IllegalArgumentException- if routeParameters is null- Since:
- 100.11.0
- See Also:
RouteResult
-
-
Method Detail
-
getNetworkEdgeGeometries
public ArcGISFeatureTable getNetworkEdgeGeometries()
Gets aArcGISFeatureTablecontaining thePolylinegeometries that theRouteTask's network is based on. During the re-routing the geometries are used to determine if the current location is on or near the navigation network. The re-routing calculation will be skipped if the current location is off the network. The geometry type of the feature table must Polyline.Setting this property is only needed when the
RouteTaskfor the navigation is based on a service. When theRouteTaskis based on local data on the device, access to thePolylinegeometries is already available to the re-routing algorithm via the Runtime.The
FeatureTablecan be the original network source data or one created specifically for checking if located on an edge.If there are multiple sources the geometries should be merged into a single table.
Only the geometries are needed in the
ArcGISFeatureTable, not the attributes.Online feature service should support pagination, otherwise
RouteTracker.enableReroutingAsync(ReroutingParameters)will throw an exception. To improve performance online feature service should have a maxRecordCount ≥ 2000 (this decreases the count of online queries).- Returns:
- a
FeatureTablecontaining thePolylinegeometries that theRouteTask's network is based on. During the re-routing the geometries are used to determine if the current location is on or near the navigation network. The re-routing calculation will be skipped if the current location is off the network. The geometry type of the feature table must be Polyline. Returns null if none. - Since:
- 100.11.0
-
setNetworkEdgeGeometries
public void setNetworkEdgeGeometries(ArcGISFeatureTable networkEdgeGeometries)
Sets aFeatureTablecontaining thePolylinegeometries that theRouteTask's network is based on. During the re-routing the geometries are used to determine if the current location is on or near the navigation network. The re-routing calculation will be skipped if the current location is off the network. The geometry type of the feature table must Polyline.Setting this property is only needed when the
RouteTaskfor the navigation is based on a service. When theRouteTaskis based on local data on the device, access to thePolylinegeometries is already available to the re-routing algorithm via the Runtime.The
FeatureTablecan be the original network source data or one created specifically for checking if located on an edge.If there are multiple sources the geometries should be merged into a single table.
Only the geometries are needed in the
FeatureTable, not the attributes.Online feature service should support pagination, otherwise
RouteTracker.enableReroutingAsync(ReroutingParameters)will throw an exception. To improve performance online feature service should have a maxRecordCount ≥ 2000 (this decreases the count of online queries).- Parameters:
networkEdgeGeometries- aFeatureTablecontaining thePolylinegeometries that theRouteTask's network is based on. During the re-routing the geometries are used to determine if the current location is on or near the navigation network. The re-routing calculation will be skipped if the current location is off the network. The geometry type of the feature table must bePolyline.- Since:
- 100.11.0
-
getRouteParameters
public RouteParameters getRouteParameters()
Gets aRouteParametersobject that defines parameters for the reroutingRouteTask.The following
RouteParametersproperties will be ignored:- Returns:
- a
RouteParametersobject that defines parameters for the reroutingRouteTask - Since:
- 100.11.0
-
getRouteTask
public RouteTask getRouteTask()
Gets aRouteTaskcapable of solving routes on the same network that created the original route.This is usually the same
RouteTaskthat was used to create the route being tracked. TheRouteTaskwill be used for rerouting in background thread.- Returns:
- a
RouteTaskcapable of solving routes on the same network that created the original route - Since:
- 100.11.0
-
getStrategy
public RouteTracker.ReroutingStrategy getStrategy()
Gets a rerouting strategy that determines how new routes are created (to the next waypoint by default).- Returns:
- a rerouting strategy that determines how new routes are created (to the next waypoint by default)
- Since:
- 100.11.0
-
setStrategy
public void setStrategy(RouteTracker.ReroutingStrategy strategy)
Sets a rerouting strategy that determines how new routes are created (to the next waypoint by default).- Parameters:
strategy- a rerouting strategy that determines how new routes are created (to the next waypoint by default)- Throws:
java.lang.IllegalArgumentException- if strategy is null- Since:
- 100.11.0
-
isVisitFirstStopOnStart
public boolean isVisitFirstStopOnStart()
Whether the first stop must be visited when rerouted (false by default).- Returns:
- whether the first stop must be visited when rerouted (false by default)
- Since:
- 100.11.0
-
setVisitFirstStopOnStart
public void setVisitFirstStopOnStart(boolean visitFirstStopOnStart)
Whether the first stop must be visited when rerouted (false by default).- Parameters:
visitFirstStopOnStart- whether the first stop must be visited when rerouted (false by default)- Since:
- 100.11.0
-
-