Class ReroutingParameters
- java.lang.Object
-
- com.esri.arcgisruntime.navigation.ReroutingParameters
-
public final class ReroutingParameters extends java.lang.Object
Represents 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 ArcGISFeatureTable
getNetworkEdgeGeometries()
Gets aArcGISFeatureTable
containing thePolyline
geometries that theRouteTask
's network is based on.RouteParameters
getRouteParameters()
Gets aRouteParameters
object that defines parameters for the reroutingRouteTask
.RouteTask
getRouteTask()
Gets aRouteTask
capable of solving routes on the same network that created the original route.RouteTracker.ReroutingStrategy
getStrategy()
Gets a rerouting strategy that determines how new routes are created (to the next waypoint by default).boolean
isVisitFirstStopOnStart()
Whether the first stop must be visited when rerouted (false by default).void
setNetworkEdgeGeometries(ArcGISFeatureTable networkEdgeGeometries)
void
setStrategy(RouteTracker.ReroutingStrategy strategy)
Sets a rerouting strategy that determines how new routes are created (to the next waypoint by default).void
setVisitFirstStopOnStart(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
RouteTask
orRouteParameters
are null.- Parameters:
routeTask
- aRouteTask
capable of solving routes on the same network used by the original routerouteParameters
- creates a re-routing parameters object based on aRouteTask
andRouteParameters
- 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 aArcGISFeatureTable
containing thePolyline
geometries 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
RouteTask
for the navigation is based on a service. When theRouteTask
is based on local data on the device, access to thePolyline
geometries is already available to the re-routing algorithm via the Runtime.The
FeatureTable
can 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
FeatureTable
containing thePolyline
geometries 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 aFeatureTable
containing thePolyline
geometries 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
RouteTask
for the navigation is based on a service. When theRouteTask
is based on local data on the device, access to thePolyline
geometries is already available to the re-routing algorithm via the Runtime.The
FeatureTable
can 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
- aFeatureTable
containing thePolyline
geometries 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 aRouteParameters
object that defines parameters for the reroutingRouteTask
.The following
RouteParameters
properties will be ignored:- Returns:
- a
RouteParameters
object that defines parameters for the reroutingRouteTask
- Since:
- 100.11.0
-
getRouteTask
public RouteTask getRouteTask()
Gets aRouteTask
capable of solving routes on the same network that created the original route.This is usually the same
RouteTask
that was used to create the route being tracked. TheRouteTask
will be used for rerouting in background thread.- Returns:
- a
RouteTask
capable 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
-
-