Class RouteParameters
- java.lang.Object
-
- com.esri.arcgisruntime.tasks.networkanalysis.RouteParameters
-
public final class RouteParameters extends java.lang.Object
Represents input parameters for computing routes usingRouteTask
. UseRouteTask.createDefaultParametersAsync()
to get an instance of this class that is initialized with smart default values based on the task's metadataRouteTask.getRouteTaskInfo()
.- Since:
- 100.0.0
-
-
Constructor Summary
Constructors Constructor Description RouteParameters()
Creates an instance of RouteParameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
clearPointBarriers()
Clears any point barriers that have been set usingsetPointBarriers(Iterable)
orsetPointBarriers(ArcGISFeatureTable, QueryParameters)
.void
clearPolygonBarriers()
Clears any polygon barriers that have been set usingsetPolygonBarriers(Iterable)
orsetPolygonBarriers(ArcGISFeatureTable, QueryParameters)
.void
clearPolylineBarriers()
Clears any polyline barriers that have been set usingsetPolylineBarriers(Iterable)
orsetPolylineBarriers(ArcGISFeatureTable, QueryParameters)
.void
clearStops()
Clears any stops that have been set usingsetStops(Iterable)
orsetStops(ArcGISFeatureTable, QueryParameters)
.java.util.List<java.lang.String>
getAccumulateAttributeNames()
Gets a list of network attributes to be accumulated and returned as part of the route.UnitSystem
getDirectionsDistanceUnits()
Gets the unit system of measurement used when providing distances for turn-by-turn directions.java.lang.String
getDirectionsLanguage()
Gets the language used when reporting directions.DirectionsStyle
getDirectionsStyle()
Gets the style being used for providing directions.SpatialReference
getOutputSpatialReference()
Gets the spatial reference in which the result geometries are returned.java.util.List<PointBarrier>
getPointBarriers()
Deprecated.As of 100.1.0, replaced bysetPointBarriers(Iterable)
.java.util.List<PolygonBarrier>
getPolygonBarriers()
Deprecated.As of 100.1.0, replaced bysetPolygonBarriers(Iterable)
.java.util.List<PolylineBarrier>
getPolylineBarriers()
Deprecated.As of 100.1.0, replaced bysetPolylineBarriers(Iterable)
.RouteShapeType
getRouteShapeType()
Gets the route shape type.java.lang.String
getSearchWhereClause(java.lang.String sourceName)
Gets the search where clause.java.util.Calendar
getStartTime()
Gets the start time that was set.java.util.List<Stop>
getStops()
Deprecated.As of 100.1.0, replaced bysetStops(Iterable)
.TravelMode
getTravelMode()
Gets the travel mode that was set.boolean
isFindBestSequence()
Indicates if the order of the stops can be changed in order to find the optimal route between all stops.boolean
isPreserveFirstStop()
Indicates if the first input stop is preserved as the first stop on the solved route.boolean
isPreserveLastStop()
Indicates if the last input stop is preserved as the last stop on the solved route.boolean
isReturnDirections()
Gets whether to return direction maneuvers in the result.boolean
isReturnPointBarriers()
Indicates if point barriers will be returned in the resultRouteResult.getPointBarriers()
.boolean
isReturnPolygonBarriers()
Indicates if polygon barriers will be returned in the resultRouteResult.getPolygonBarriers()
.boolean
isReturnPolylineBarriers()
Indicates if polyline barriers will be returned in the resultRouteResult.getPolylineBarriers()
.boolean
isReturnRoutes()
Gets whether to return routes in the resultRouteResult.getRoutes()
.boolean
isReturnStops()
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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String sourceName, java.lang.String searchWhereClause)
Sets the search where clause.void
setStartTime(java.util.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
setStops(java.lang.Iterable<Stop> stops)
Sets the stops to visit in the result route.void
setTravelMode(TravelMode travelMode)
Sets the travel mode.
-
-
-
Constructor Detail
-
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:
RouteTask.createDefaultParametersAsync()
-
-
Method Detail
-
getAccumulateAttributeNames
public java.util.List<java.lang.String> 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
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:
java.lang.IllegalArgumentException
- if travelMode is null- Since:
- 100.0.0
-
getSearchWhereClause
public java.lang.String getSearchWhereClause(java.lang.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(java.lang.String sourceName, java.lang.String searchWhereClause)
Sets the search where clause.- Parameters:
sourceName
- source namesearchWhereClause
- search where clause- Since:
- 100.0.0
-
getStartTime
public java.util.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(java.util.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:
setPreserveFirstStop(boolean)
,setPreserveLastStop(boolean)
-
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
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:
java.lang.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 byRouteTaskInfo.getOutputSpatialReference()
.- Parameters:
outputSpatialReference
- output spatial reference- Throws:
java.lang.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
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
- See Also:
UnitSystem
-
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:
java.lang.IllegalArgumentException
- if directionsDistanceUnits is null- Since:
- 100.0.0
- See Also:
UnitSystem
-
getDirectionsLanguage
public java.lang.String getDirectionsLanguage()
Gets the language used when reporting directions.- Returns:
- the directions language
- Since:
- 100.0.0
-
setDirectionsLanguage
public void setDirectionsLanguage(java.lang.String directionsLanguage)
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
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:
java.lang.IllegalArgumentException
- if directionsStyle is null- Since:
- 100.0.0
-
getStops
@Deprecated public java.util.List<Stop> getStops()
Deprecated.As of 100.1.0, replaced bysetStops(Iterable)
.This method is a deprecated way to set the stops to visit in the result route. Initially it returns an empty list. Adding stops to this list automatically updates the stops in the same way as callingsetStops(Iterable)
would. The new way to set a collection of stops is to create your own collection and pass it tosetStops(Iterable)
.- Returns:
- a modifiable list of stops
- Since:
- 100.0.0
-
setStops
public void setStops(java.lang.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:
java.lang.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 tablequeryParameters
- the query parameters- Throws:
java.lang.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
-
getPointBarriers
@Deprecated public java.util.List<PointBarrier> getPointBarriers()
Deprecated.As of 100.1.0, replaced bysetPointBarriers(Iterable)
.This method is a deprecated way to set the point barriers to avoid in the result route. Initially it returns an empty list. Adding point barriers to this list automatically updates the point barriers in the same way as callingsetPointBarriers(Iterable)
would. The new way to set a collection of point barriers is to create your own collection and pass it tosetPointBarriers(Iterable)
.- Returns:
- a modifiable list of point barriers
- Since:
- 100.0.0
-
setPointBarriers
public void setPointBarriers(java.lang.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:
java.lang.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 tablequeryParameters
- the query parameters- Throws:
java.lang.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
-
getPolylineBarriers
@Deprecated public java.util.List<PolylineBarrier> getPolylineBarriers()
Deprecated.As of 100.1.0, replaced bysetPolylineBarriers(Iterable)
.This method is a deprecated way to set the polyline barriers to avoid in the result route. Initially it returns an empty list. Adding polyline barriers to this list automatically updates the polyline barriers in the same way as callingsetPolylineBarriers(Iterable)
would. The new way to set a collection of polyline barriers is to create your own collection and pass it tosetPolylineBarriers(Iterable)
.- Returns:
- a modifiable list of polyline barriers
- Since:
- 100.0.0
-
setPolylineBarriers
public void setPolylineBarriers(java.lang.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:
java.lang.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 tablequeryParameters
- the query parameters- Throws:
java.lang.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
-
getPolygonBarriers
@Deprecated public java.util.List<PolygonBarrier> getPolygonBarriers()
Deprecated.As of 100.1.0, replaced bysetPolygonBarriers(Iterable)
.This method is a deprecated way to set the polygon barriers to avoid in the result route. Initially it returns an empty list. Adding polygon barriers to this list automatically updates the polygon barriers in the same way as callingsetPolygonBarriers(Iterable)
would. The new way to set a collection of polygon barriers is to create your own collection and pass it tosetPolygonBarriers(Iterable)
.- Returns:
- a modifiable list of polygon barriers
- Since:
- 100.0.0
-
setPolygonBarriers
public void setPolygonBarriers(java.lang.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:
java.lang.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 tablequeryParameters
- the query parameters- Throws:
java.lang.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
-
-