Class 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 Detail

      • ReroutingParameters

        public ReroutingParameters​(RouteTask routeTask,
                                   RouteParameters routeParameters)
        Creates a Rerouting parameters.

        An exception is thrown if the RouteTask or RouteParameters are null.

        Parameters:
        routeTask - a RouteTask capable of solving routes on the same network used by the original route
        routeParameters - creates a re-routing parameters object based on a RouteTask and RouteParameters
        Throws:
        java.lang.IllegalArgumentException - if routeTask is null
        java.lang.IllegalArgumentException - if routeParameters is null
        Since:
        100.11.0
        See Also:
        RouteResult
    • Method Detail

      • getNetworkEdgeGeometries

        public ArcGISFeatureTable getNetworkEdgeGeometries()
        Gets a ArcGISFeatureTable containing the Polyline geometries that the RouteTask'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 the RouteTask is based on local data on the device, access to the Polyline 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 the Polyline geometries that the RouteTask'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 a FeatureTable containing the Polyline geometries that the RouteTask'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 the RouteTask is based on local data on the device, access to the Polyline 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 - a FeatureTable containing the Polyline geometries that the RouteTask'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.
        Since:
        100.11.0
      • getRouteTask

        public RouteTask getRouteTask()
        Gets a RouteTask 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. The RouteTask 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