java.lang.Object
com.esri.arcgisruntime.tasks.networkanalysis.RouteParameters

public final class RouteParameters extends Object
Represents input parameters for computing routes using RouteTask. Use RouteTask.createDefaultParametersAsync() to get an instance of this class that is initialized with smart default values based on the task's metadata RouteTask.getRouteTaskInfo().
Since:
100.0.0
  • Constructor Details

  • Method Details

    • getAccumulateAttributeNames

      public List<String> getAccumulateAttributeNames()
      Gets a list of network attributes to be accumulated and returned as part of the route. Available attributes are specified by RouteTaskInfo.getAccumulateAttributeNames().
      Returns:
      the accumulate attribute names
      Since:
      100.0.0
    • getTravelMode

      public TravelMode getTravelMode()
      Gets the travel mode that was set.
      Returns:
      the travel mode. Returns the default based on the database if the travel mode is not set.
      Since:
      100.0.0
    • setTravelMode

      public void setTravelMode(TravelMode travelMode)
      Sets the travel mode.
      Parameters:
      travelMode - travel mode
      Throws:
      IllegalArgumentException - if travelMode is null
      Since:
      100.0.0
    • getSearchWhereClause

      public String getSearchWhereClause(String sourceName)
      Gets the search where clause.
      Parameters:
      sourceName - source name
      Returns:
      the search where clause. Returns empty string if sourceName was not set.
      Since:
      100.0.0
    • setSearchWhereClause

      public void setSearchWhereClause(String sourceName, String searchWhereClause)
      Sets the search where clause.
      Parameters:
      sourceName - source name
      searchWhereClause - search where clause
      Since:
      100.0.0
    • getStartTime

      public Calendar getStartTime()
      Gets the start time that was set.
      Returns:
      the start time. Returns null if it was not set
      Since:
      100.0.0
    • setStartTime

      public void setStartTime(Calendar startTime)
      Sets the time the route begins. If not specified, defaults to the time the task is executed.
      Parameters:
      startTime - start time. It can be null.
      Since:
      100.0.0
    • isFindBestSequence

      public boolean isFindBestSequence()
      Indicates if the order of the stops can be changed in order to find the optimal route between all stops.
      Returns:
      true if the order of stops can be changed, false otherwise
      Since:
      100.0.0
    • setFindBestSequence

      public void setFindBestSequence(boolean findBestSequence)
      Sets if the order of the stops can be changed in order to find the optimal route between all stops.
      Parameters:
      findBestSequence - find best sequence
      Since:
      100.0.0
      See Also:
    • isPreserveFirstStop

      public boolean isPreserveFirstStop()
      Indicates if the first input stop is preserved as the first stop on the solved route. Has no affect if isFindBestSequence is false.
      Returns:
      true if the first stop is preserved as the route departure location; false otherwise
      Since:
      100.0.0
    • setPreserveFirstStop

      public void setPreserveFirstStop(boolean preserveFirstStop)
      Specifies whether to keep the first stop fixed in the sequence even when setFindBestSequence(boolean) is enabled. Only applicable if setFindBestSequence(boolean) is enabled.
      Parameters:
      preserveFirstStop - preserve first stop
      Since:
      100.0.0
    • isPreserveLastStop

      public boolean isPreserveLastStop()
      Indicates if the last input stop is preserved as the last stop on the solved route. Has no affect if isFindBestSequence is false.
      Returns:
      true if the last stop is preserved as the route departure location; false otherwise
      Since:
      100.0.0
    • setPreserveLastStop

      public void setPreserveLastStop(boolean preserveLastStop)
      Specifies whether to keep the last stop fixed in the sequence even when setFindBestSequence(boolean) is enabled. Only applicable if setFindBestSequence(boolean) is enabled.
      Parameters:
      preserveLastStop - preserve last stop
      Since:
      100.0.0
    • getRouteShapeType

      public RouteShapeType getRouteShapeType()
      Gets the route shape type.
      Returns:
      the route shape type
      Since:
      100.0.0
    • setRouteShapeType

      public void setRouteShapeType(RouteShapeType routeShapeType)
      Sets the route shape type.
      Parameters:
      routeShapeType - route shape type
      Throws:
      IllegalArgumentException - if routeShapeType is null
      Since:
      100.0.0
    • getOutputSpatialReference

      public SpatialReference getOutputSpatialReference()
      Gets the spatial reference in which the result geometries are returned.
      Returns:
      the output spatial reference
      Since:
      100.0.0
    • setOutputSpatialReference

      public void setOutputSpatialReference(SpatialReference outputSpatialReference)
      Sets the spatial reference in which the result geometries should be returned. If not specified then the results will be returned in the spatial reference specified by RouteTaskInfo.getOutputSpatialReference().
      Parameters:
      outputSpatialReference - output spatial reference
      Throws:
      IllegalArgumentException - if outputSpatialReference is null
      Since:
      100.0.0
    • isReturnStops

      public boolean isReturnStops()
      Gets whether returning stops in the result Route.getStops() is enabled or not.
      Returns:
      true if returning stops in the result is enabled, false otherwise
      Since:
      100.0.0
    • setReturnStops

      public void setReturnStops(boolean returnStops)
      Sets whether to return the stops along each route in the result Route.getStops()
      Parameters:
      returnStops - whether to return stops
      Since:
      100.0.0
    • isReturnPointBarriers

      public boolean isReturnPointBarriers()
      Indicates if point barriers will be returned in the result RouteResult.getPointBarriers().
      Returns:
      true if returning point barriers in the result is enabled, false otherwise
      Since:
      100.0.0
    • setReturnPointBarriers

      public void setReturnPointBarriers(boolean returnPointBarriers)
      Sets whether to return point barriers used while computing the route, in the result RouteResult.getPointBarriers().
      Parameters:
      returnPointBarriers - whether to return point barriers
      Since:
      100.0.0
    • isReturnPolylineBarriers

      public boolean isReturnPolylineBarriers()
      Indicates if polyline barriers will be returned in the result RouteResult.getPolylineBarriers().
      Returns:
      true if returning polyline barriers in the result is enabled, false otherwise
      Since:
      100.0.0
    • setReturnPolylineBarriers

      public void setReturnPolylineBarriers(boolean returnPolylineBarriers)
      Sets whether to return polyline barriers used while computing the route, in the result RouteResult.getPolylineBarriers().
      Parameters:
      returnPolylineBarriers - whether to return polyline barriers
      Since:
      100.0.0
    • isReturnPolygonBarriers

      public boolean isReturnPolygonBarriers()
      Indicates if polygon barriers will be returned in the result RouteResult.getPolygonBarriers().
      Returns:
      true if returning polygon barriers in the result is enabled, false otherwise
      Since:
      100.0.0
    • setReturnPolygonBarriers

      public void setReturnPolygonBarriers(boolean returnPolygonBarriers)
      Sets whether to return polygon barriers used while computing the route, in the result RouteResult.getPolygonBarriers().
      Parameters:
      returnPolygonBarriers - whether to return polygon barriers
      Since:
      100.0.0
    • isReturnRoutes

      public boolean isReturnRoutes()
      Gets whether to return routes in the result RouteResult.getRoutes().
      Returns:
      if the routes will be returned in the result, false otherwise
      Since:
      100.0.0
    • setReturnRoutes

      public void setReturnRoutes(boolean returnRoutes)
      Sets to return routes in the result RouteResult.getRoutes().
      Parameters:
      returnRoutes - whether to return routes
      Since:
      100.0.0
    • isReturnDirections

      public boolean isReturnDirections()
      Gets whether to return direction maneuvers in the result.
      Returns:
      true if the direction maneuvers are returned in the result, false otherwise
      Since:
      100.0.0
    • setReturnDirections

      public void setReturnDirections(boolean returnDirections)
      Sets whether to return turn-by-turn directions in the result Route.getDirectionManeuvers().
      Parameters:
      returnDirections - whether to return direction maneuvers with the result routes
      Since:
      100.0.0
    • getDirectionsDistanceUnits

      public UnitSystem getDirectionsDistanceUnits()
      Gets the unit system of measurement used when providing distances for turn-by-turn directions.
      Returns:
      the unit system of measurement
      Since:
      100.0.0
    • setDirectionsDistanceUnits

      public void setDirectionsDistanceUnits(UnitSystem directionsDistanceUnits)
      Sets the unit system of measurement used when providing distances for turn-by-turn directions.
      Parameters:
      directionsDistanceUnits - the unit system of measurement
      Throws:
      IllegalArgumentException - if directionsDistanceUnits is null
      Since:
      100.0.0
    • getDirectionsLanguage

      public String getDirectionsLanguage()
      Gets the language used when reporting directions.
      Returns:
      the directions language
      Since:
      100.0.0
    • setDirectionsLanguage

      public void setDirectionsLanguage(String directionsLanguage)
      Sets the language used when reporting directions. The list of supported languages can be obtained by calling RouteTaskInfo.getSupportedLanguages().
      Parameters:
      directionsLanguage - directions language
      Since:
      100.0.0
    • getDirectionsStyle

      public DirectionsStyle getDirectionsStyle()
      Gets the style being used for providing directions.
      Returns:
      the directions style
      Since:
      100.0.0
    • setDirectionsStyle

      public void setDirectionsStyle(DirectionsStyle directionsStyle)
      Sets the style to use for providing directions.
      Parameters:
      directionsStyle - directions style
      Throws:
      IllegalArgumentException - if directionsStyle is null
      Since:
      100.0.0
    • setStops

      public void setStops(Iterable<Stop> stops)
      Sets the stops to visit in the result route.

      Note: calling this method causes any stops set by a previous call to setStops(ArcGISFeatureTable, QueryParameters) to be cleared.

      Parameters:
      stops - the stops
      Throws:
      IllegalArgumentException - if stops is null
      Since:
      100.1.0
    • setStops

      public void setStops(ArcGISFeatureTable featureTable, QueryParameters queryParameters)
      Sets the stops to visit in the result route, using features in a given feature table.

      The feature table can be either local or online and must be of geometry type point. Attributes from the feature table are mapped to the properties on the stops objects generated from the feature table. The where clause set in the query parameters will be applied to the feature table. If an online feature table is specified the table will not be queried for features until RouteTask.solveRouteAsync(RouteParameters) is called.

      Note: calling this method causes any stops set by a previous call to setStops(Iterable) to be cleared.

      Parameters:
      featureTable - the feature table
      queryParameters - the query parameters
      Throws:
      IllegalArgumentException - if featureTable or queryParameters is null
      Since:
      100.0.0
    • clearStops

      public void clearStops()
      Clears any stops that have been set using setStops(Iterable) or setStops(ArcGISFeatureTable, QueryParameters).
      Since:
      100.1.0
    • setPointBarriers

      public void setPointBarriers(Iterable<PointBarrier> barriers)
      Sets the point barriers to avoid in the result route.

      Note: calling this method causes any point barriers set by a previous call to setPointBarriers(ArcGISFeatureTable, QueryParameters) to be cleared.

      Parameters:
      barriers - the point barriers
      Throws:
      IllegalArgumentException - if barriers is null
      Since:
      100.1.0
    • setPointBarriers

      public void setPointBarriers(ArcGISFeatureTable featureTable, QueryParameters queryParameters)
      Sets the point barriers to avoid in the result route, using features in a given feature table.

      The feature table can be either local or online and must be of geometry type point. Attributes from the feature table are mapped to the properties on the barrier objects generated from the specified feature table. The where clause set in the query parameters will be applied to the feature table. If an online feature table is specified the table will not be queried for features until RouteTask.solveRouteAsync(RouteParameters) is called.

      Note: calling this method causes any point barriers set by a previous call to setPointBarriers(Iterable) to be cleared.

      Parameters:
      featureTable - the feature table
      queryParameters - the query parameters
      Throws:
      IllegalArgumentException - if featureTable or queryParameters is null
      Since:
      100.0.0
    • clearPointBarriers

      public void clearPointBarriers()
      Clears any point barriers that have been set using setPointBarriers(Iterable) or setPointBarriers(ArcGISFeatureTable, QueryParameters).
      Since:
      100.1.0
    • setPolylineBarriers

      public void setPolylineBarriers(Iterable<PolylineBarrier> barriers)
      Sets the polyline barriers to avoid in the result route.

      Note: calling this method causes any polyline barriers set by a previous call to setPolylineBarriers(ArcGISFeatureTable, QueryParameters) to be cleared.

      Parameters:
      barriers - the polyline barriers
      Throws:
      IllegalArgumentException - if barriers is null
      Since:
      100.1.0
    • setPolylineBarriers

      public void setPolylineBarriers(ArcGISFeatureTable featureTable, QueryParameters queryParameters)
      Sets the polyline barriers to avoid in the result route, using features in a given feature table.

      The feature table can be either local or online and must be of geometry type polyline. Attributes from the feature table are mapped to the properties on the barrier objects generated from the specified feature table. The where clause set in the query parameters will be applied to the feature table. If an online feature table is specified the table will not be queried for features until RouteTask.solveRouteAsync(RouteParameters) is called.

      Note: calling this method causes any polyline barriers set by a previous call to setPolylineBarriers(Iterable) to be cleared.

      Parameters:
      featureTable - the feature table
      queryParameters - the query parameters
      Throws:
      IllegalArgumentException - if featureTable or queryParameters is null
      Since:
      100.0.0
    • clearPolylineBarriers

      public void clearPolylineBarriers()
      Clears any polyline barriers that have been set using setPolylineBarriers(Iterable) or setPolylineBarriers(ArcGISFeatureTable, QueryParameters).
      Since:
      100.1.0
    • setPolygonBarriers

      public void setPolygonBarriers(Iterable<PolygonBarrier> barriers)
      Sets the polygon barriers to avoid in the result route.

      Note: calling this method causes any polygon barriers set by a previous call to setPolygonBarriers(ArcGISFeatureTable, QueryParameters) to be cleared.

      Parameters:
      barriers - the polygon barriers
      Throws:
      IllegalArgumentException - if barriers is null
      Since:
      100.1.0
    • setPolygonBarriers

      public void setPolygonBarriers(ArcGISFeatureTable featureTable, QueryParameters queryParameters)
      Sets the polygon barriers to avoid in the result route, using features in a given feature table.

      The feature table can be either local or online and must be of geometry type polygon. Attributes from the feature table are mapped to the properties on the barrier objects generated from the specified feature table. The where clause set in the query parameters will be applied to the feature table. If an online feature table is specified the table will not be queried for features until RouteTask.solveRouteAsync(RouteParameters) is called.

      Note: calling this method causes any polygon barriers set by a previous call to setPolygonBarriers(Iterable) to be cleared.

      Parameters:
      featureTable - the feature table
      queryParameters - the query parameters
      Throws:
      IllegalArgumentException - if featureTable or queryParameters is null
      Since:
      100.0.0
    • clearPolygonBarriers

      public void clearPolygonBarriers()
      Clears any polygon barriers that have been set using setPolygonBarriers(Iterable) or setPolygonBarriers(ArcGISFeatureTable, QueryParameters).
      Since:
      100.1.0