Class RouteParameters
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears any point barriers that have been set usingsetPointBarriers(Iterable)
orsetPointBarriers(ArcGISFeatureTable, QueryParameters)
.void
Clears any polygon barriers that have been set usingsetPolygonBarriers(Iterable)
orsetPolygonBarriers(ArcGISFeatureTable, QueryParameters)
.void
Clears any polyline barriers that have been set usingsetPolylineBarriers(Iterable)
orsetPolylineBarriers(ArcGISFeatureTable, QueryParameters)
.void
Clears any stops that have been set usingsetStops(Iterable)
orsetStops(ArcGISFeatureTable, QueryParameters)
.Gets a list of network attributes to be accumulated and returned as part of the route.Gets the unit system of measurement used when providing distances for turn-by-turn directions.Gets the language used when reporting directions.Gets the style being used for providing directions.Gets the spatial reference in which the result geometries are returned.Gets the route shape type.getSearchWhereClause
(String sourceName) Gets the search where clause.Gets the start time that was set.Gets the travel mode that was set.boolean
Indicates if the order of the stops can be changed in order to find the optimal route between all stops.boolean
Indicates if the first input stop is preserved as the first stop on the solved route.boolean
Indicates if the last input stop is preserved as the last stop on the solved route.boolean
Gets whether to return direction maneuvers in the result.boolean
Indicates if point barriers will be returned in the resultRouteResult.getPointBarriers()
.boolean
Indicates if polygon barriers will be returned in the resultRouteResult.getPolygonBarriers()
.boolean
Indicates if polyline barriers will be returned in the resultRouteResult.getPolylineBarriers()
.boolean
Gets whether to return routes in the resultRouteResult.getRoutes()
.boolean
Gets whether returning stops in the resultRoute.getStops()
is enabled or not.void
setDirectionsDistanceUnits
(UnitSystem directionsDistanceUnits) Sets the unit system of measurement used when providing distances for turn-by-turn directions.void
setDirectionsLanguage
(String directionsLanguage) Sets the language used when reporting directions.void
setDirectionsStyle
(DirectionsStyle directionsStyle) Sets the style to use for providing directions.void
setFindBestSequence
(boolean findBestSequence) Sets if the order of the stops can be changed in order to find the optimal route between all stops.void
setOutputSpatialReference
(SpatialReference outputSpatialReference) Sets the spatial reference in which the result geometries should be returned.void
setPointBarriers
(ArcGISFeatureTable featureTable, QueryParameters queryParameters) Sets the point barriers to avoid in the result route, using features in a given feature table.void
setPointBarriers
(Iterable<PointBarrier> barriers) Sets the point barriers to avoid in the result route.void
setPolygonBarriers
(ArcGISFeatureTable featureTable, QueryParameters queryParameters) Sets the polygon barriers to avoid in the result route, using features in a given feature table.void
setPolygonBarriers
(Iterable<PolygonBarrier> barriers) Sets the polygon barriers to avoid in the result route.void
setPolylineBarriers
(ArcGISFeatureTable featureTable, QueryParameters queryParameters) Sets the polyline barriers to avoid in the result route, using features in a given feature table.void
setPolylineBarriers
(Iterable<PolylineBarrier> barriers) Sets the polyline barriers to avoid in the result route.void
setPreserveFirstStop
(boolean preserveFirstStop) Specifies whether to keep the first stop fixed in the sequence even whensetFindBestSequence(boolean)
is enabled.void
setPreserveLastStop
(boolean preserveLastStop) Specifies whether to keep the last stop fixed in the sequence even whensetFindBestSequence(boolean)
is enabled.void
setReturnDirections
(boolean returnDirections) Sets whether to return turn-by-turn directions in the resultRoute.getDirectionManeuvers()
.void
setReturnPointBarriers
(boolean returnPointBarriers) Sets whether to return point barriers used while computing the route, in the resultRouteResult.getPointBarriers()
.void
setReturnPolygonBarriers
(boolean returnPolygonBarriers) Sets whether to return polygon barriers used while computing the route, in the resultRouteResult.getPolygonBarriers()
.void
setReturnPolylineBarriers
(boolean returnPolylineBarriers) Sets whether to return polyline barriers used while computing the route, in the resultRouteResult.getPolylineBarriers()
.void
setReturnRoutes
(boolean returnRoutes) Sets to return routes in the resultRouteResult.getRoutes()
.void
setReturnStops
(boolean returnStops) Sets whether to return the stops along each route in the resultRoute.getStops()
void
setRouteShapeType
(RouteShapeType routeShapeType) Sets the route shape type.void
setSearchWhereClause
(String sourceName, String searchWhereClause) Sets the search where clause.void
setStartTime
(Calendar startTime) Sets the time the route begins.void
setStops
(ArcGISFeatureTable featureTable, QueryParameters queryParameters) Sets the stops to visit in the result route, using features in a given feature table.void
Sets the stops to visit in the result route.void
setTravelMode
(TravelMode travelMode) Sets the travel mode.
-
Constructor Details
-
RouteParameters
public RouteParameters()Creates an instance of RouteParameters. The recommended way is to useRouteTask.createDefaultParametersAsync()
, which creates a set of necessary default parameters required for solving a route with a particular RouteTask.- Since:
- 100.1.0
- See Also:
-
-
Method Details
-
getAccumulateAttributeNames
Gets a list of network attributes to be accumulated and returned as part of the route. Available attributes are specified byRouteTaskInfo.getAccumulateAttributeNames()
.- Returns:
- the accumulate attribute names
- Since:
- 100.0.0
-
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
Sets the travel mode.- Parameters:
travelMode
- travel mode- Throws:
IllegalArgumentException
- if travelMode is null- Since:
- 100.0.0
-
getSearchWhereClause
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
Sets the search where clause.- Parameters:
sourceName
- source namesearchWhereClause
- search where clause- Since:
- 100.0.0
-
getStartTime
Gets the start time that was set.- Returns:
- the start time. Returns null if it was not set
- Since:
- 100.0.0
-
setStartTime
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 whensetFindBestSequence(boolean)
is enabled. Only applicable ifsetFindBestSequence(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 whensetFindBestSequence(boolean)
is enabled. Only applicable ifsetFindBestSequence(boolean)
is enabled.- Parameters:
preserveLastStop
- preserve last stop- Since:
- 100.0.0
-
getRouteShapeType
Gets the route shape type.- Returns:
- the route shape type
- Since:
- 100.0.0
-
setRouteShapeType
Sets the route shape type.- Parameters:
routeShapeType
- route shape type- Throws:
IllegalArgumentException
- if routeShapeType is null- Since:
- 100.0.0
-
getOutputSpatialReference
Gets the spatial reference in which the result geometries are returned.- Returns:
- the output spatial reference
- Since:
- 100.0.0
-
setOutputSpatialReference
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 byRouteTaskInfo.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 resultRoute.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 resultRoute.getStops()
- Parameters:
returnStops
- whether to return stops- Since:
- 100.0.0
-
isReturnPointBarriers
public boolean isReturnPointBarriers()Indicates if point barriers will be returned in the resultRouteResult.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 resultRouteResult.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 resultRouteResult.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 resultRouteResult.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 resultRouteResult.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 resultRouteResult.getPolygonBarriers()
.- Parameters:
returnPolygonBarriers
- whether to return polygon barriers- Since:
- 100.0.0
-
isReturnRoutes
public boolean isReturnRoutes()Gets whether to return routes in the resultRouteResult.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 resultRouteResult.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 resultRoute.getDirectionManeuvers()
.- Parameters:
returnDirections
- whether to return direction maneuvers with the result routes- Since:
- 100.0.0
-
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
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
Gets the language used when reporting directions.- Returns:
- the directions language
- Since:
- 100.0.0
-
setDirectionsLanguage
Sets the language used when reporting directions. The list of supported languages can be obtained by callingRouteTaskInfo.getSupportedLanguages()
.- Parameters:
directionsLanguage
- directions language- Since:
- 100.0.0
-
getDirectionsStyle
Gets the style being used for providing directions.- Returns:
- the directions style
- Since:
- 100.0.0
-
setDirectionsStyle
Sets the style to use for providing directions.- Parameters:
directionsStyle
- directions style- Throws:
IllegalArgumentException
- if directionsStyle is null- Since:
- 100.0.0
-
setStops
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
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 tablequeryParameters
- 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 usingsetStops(Iterable)
orsetStops(ArcGISFeatureTable, QueryParameters)
.- Since:
- 100.1.0
-
setPointBarriers
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
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 tablequeryParameters
- 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 usingsetPointBarriers(Iterable)
orsetPointBarriers(ArcGISFeatureTable, QueryParameters)
.- Since:
- 100.1.0
-
setPolylineBarriers
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
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 tablequeryParameters
- 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 usingsetPolylineBarriers(Iterable)
orsetPolylineBarriers(ArcGISFeatureTable, QueryParameters)
.- Since:
- 100.1.0
-
setPolygonBarriers
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
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 tablequeryParameters
- 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 usingsetPolygonBarriers(Iterable)
orsetPolygonBarriers(ArcGISFeatureTable, QueryParameters)
.- Since:
- 100.1.0
-