Skip To Content ArcGIS for Developers Sign In Dashboard

RouteParameters Class

(Esri::ArcGISRuntime::RouteParameters)

Parameters for a RouteTask, such as stops, barriers, and whether to return directions. More...

Header: #include <RouteParameters>
Since: Esri::ArcGISRuntime 100.0

Public Functions

RouteParameters()
RouteParameters(const RouteParameters &other)
RouteParameters(RouteParameters &&other)
~RouteParameters()
QStringList accumulateAttributeNames() const
void clearPointBarriers()
void clearPolygonBarriers()
void clearPolylineBarriers()
void clearStops()
UnitSystem directionsDistanceUnits() const
QString directionsLanguage() const
DirectionsStyle directionsStyle() const
bool isEmpty() const
bool isFindBestSequence() const
bool isPreserveFirstStop() const
bool isPreserveLastStop() const
bool isReturnDirections() const
bool isReturnPointBarriers() const
bool isReturnPolygonBarriers() const
bool isReturnPolylineBarriers() const
bool isReturnRoutes() const
bool isReturnStops() const
SpatialReference outputSpatialReference() const
RouteShapeType routeShapeType() const
QString searchWhereClause(const QString &sourceName) const
void setAccumulateAttributeNames(const QStringList &accumulateAttributeNames)
void setDirectionsDistanceUnits(UnitSystem directionsDistanceUnits)
void setDirectionsLanguage(const QString &directionsLanguage)
void setDirectionsStyle(DirectionsStyle directionsStyle)
void setFindBestSequence(bool findBestSequence)
void setOutputSpatialReference(const SpatialReference &outputSpatialReference)
void setPointBarriers(const QList<PointBarrier> &pointBarriers)
void setPointBarriersWithFeatureTable(ArcGISFeatureTable *featureTable, const QueryParameters &queryParameters)
void setPolygonBarriers(const QList<PolygonBarrier> &polygonBarriers)
void setPolygonBarriersWithFeatureTable(ArcGISFeatureTable *featureTable, const QueryParameters &queryParameters)
void setPolylineBarriers(const QList<PolylineBarrier> &polylineBarriers)
void setPolylineBarriersWithFeatureTable(ArcGISFeatureTable *featureTable, const QueryParameters &queryParameters)
void setPreserveFirstStop(bool preserveFirstStop)
void setPreserveLastStop(bool preserveLastStop)
void setReturnDirections(bool returnDirections)
void setReturnPointBarriers(bool returnPointBarriers)
void setReturnPolygonBarriers(bool returnPolygonBarriers)
void setReturnPolylineBarriers(bool returnPolylineBarriers)
void setReturnRoutes(bool returnRoutes)
void setReturnStops(bool returnStops)
void setRouteShapeType(RouteShapeType routeShapeType)
void setSearchWhereClause(const QString &sourceName, const QString &searchWhereClause)
void setStartTime(const QDateTime &startTime)
void setStops(const QList<Stop> &stops)
void setStopsWithFeatureTable(ArcGISFeatureTable *featureTable, const QueryParameters &queryParameters)
void setTravelMode(const TravelMode &travelMode)
QDateTime startTime() const
TravelMode travelMode() const
RouteParameters &operator=(const RouteParameters &other)
RouteParameters &operator=(RouteParameters &&other)

Detailed Description

Parameters for a RouteTask, such as stops, barriers, and whether to return directions.

Stops and barriers can be in any spatial reference, and do not need to be reprojected to match the network dataset's spatial reference. However, all of the stops and barriers must be in the same spatial reference. For example, the network dataset could be in WKID 4326, and your map, stops, and barriers could all be in WKID 3857. The RouteTask will automatically reproject the stops and barriers, and output the Route in whatever output spatial reference is specified.

Note: RouteParameters is only default-constructible for convenience. It should be retrieved from the RouteTask class so it will be assigned necessary defaults required to solve routes.

See also RouteTask::createDefaultParameters.

Member Function Documentation

RouteParameters::RouteParameters()

Default constructor.

RouteParameters::RouteParameters(const RouteParameters &other)

Copy constructor from other RouteParameters.

RouteParameters::RouteParameters(RouteParameters &&other)

Move constructor from other RouteParameters.

RouteParameters::~RouteParameters()

Destructor.

QStringList RouteParameters::accumulateAttributeNames() const

Returns a list of network attribute names to be accumulated with the analysis.

See also setAccumulateAttributeNames().

void RouteParameters::clearPointBarriers()

Clears the point barriers that have been set on this RouteParameters.

void RouteParameters::clearPolygonBarriers()

Clears the polygon barriers that have been set on this RouteParameters.

void RouteParameters::clearPolylineBarriers()

Clears the polyline barriers that have been set on this RouteParameters.

void RouteParameters::clearStops()

Clears the stops that have been set on this RouteParameters.

UnitSystem RouteParameters::directionsDistanceUnits() const

Returns the units in which the length information will be reported in the route directions.

See also setDirectionsDistanceUnits().

QString RouteParameters::directionsLanguage() const

Returns the language of the resulting route directions.

See also setDirectionsLanguage().

DirectionsStyle RouteParameters::directionsStyle() const

Returns the style of the resulting route directions.

See also setDirectionsStyle().

bool RouteParameters::isEmpty() const

Returns true if this RouteParameters is empty.

bool RouteParameters::isFindBestSequence() const

Returns whether the analysis should reorder stops to find the optimized route.

The default value is false.

bool RouteParameters::isPreserveFirstStop() const

Returns whether the analysis should preserve the first stop.

This parameter is applicable only if isFindBestSequence is true.

bool RouteParameters::isPreserveLastStop() const

Returns whether the analysis should preserve the last stop.

This parameter is applicable only if isFindBestSequence is true.

bool RouteParameters::isReturnDirections() const

Returns whether directions are returned with the RouteResult.

bool RouteParameters::isReturnPointBarriers() const

Returns whether point barriers are returned with the RouteResult.

bool RouteParameters::isReturnPolygonBarriers() const

Returns whether polygon barriers are returned with the RouteResult.

bool RouteParameters::isReturnPolylineBarriers() const

Returns whether polyline barriers are returned with the RouteResult.

bool RouteParameters::isReturnRoutes() const

Returns whether routes are returned with the RouteResult.

bool RouteParameters::isReturnStops() const

Returns whether stops are returned with the RouteResult.

SpatialReference RouteParameters::outputSpatialReference() const

Returns the output spatial reference.

See also setOutputSpatialReference().

RouteShapeType RouteParameters::routeShapeType() const

Returns the output shape type for a route.

See also setRouteShapeType().

QString RouteParameters::searchWhereClause(const QString &sourceName) const

Returns the search WHERE clause from the specified sourceName.

See also setSearchWhereClause().

void RouteParameters::setAccumulateAttributeNames(const QStringList &accumulateAttributeNames)

Sets a list of accumulateAttributeNames to be returned.

See also accumulateAttributeNames().

void RouteParameters::setDirectionsDistanceUnits(UnitSystem directionsDistanceUnits)

Sets the directionsDistanceUnits in which the length information will be reported in the route directions.

See also directionsDistanceUnits().

void RouteParameters::setDirectionsLanguage(const QString &directionsLanguage)

Sets the directionsLanguage of the resulting route directions.

See also directionsLanguage().

void RouteParameters::setDirectionsStyle(DirectionsStyle directionsStyle)

Sets the directionsStyle of the resulting route directions.

See also directionsStyle().

void RouteParameters::setFindBestSequence(bool findBestSequence)

Sets whether findBestSequence is true.

This indicates whether the analysis should reorder stops to find the optimized route. The default is false.

If the parameter value is false, the analysis returns a route that visits stops in the order you define. The order you define is the order that the stops are encountered in the array of stops in the RouteParameters. For example, the Stop at index zero is first, index 1 is second, and so on. If the parameter value is true, the analysis disregards the order you defined, and finds the best order to visit the stops. You can elect to preserve the first and/or the last stops while allowing the service to reorder intermediary stops by setting setPreserveFirstStop and setPreserveLastStop.

Note: A value of true causes the analysis to switch from solving a shortest-path problem to a traveling salesperson problem (TSP). Solving a TSP is computer-intensive operation and if using an online subscription-based service (e.g. ArcGIS Online) may incur additional service credits per route.

See also isFindBestSequence().

void RouteParameters::setOutputSpatialReference(const SpatialReference &outputSpatialReference)

Sets the outputSpatialReference.

See also outputSpatialReference().

void RouteParameters::setPointBarriers(const QList<PointBarrier> &pointBarriers)

Sets the pointBarriers for a RouteTask by providing a list of PointBarrier.

void RouteParameters::setPointBarriersWithFeatureTable(ArcGISFeatureTable *featureTable, const QueryParameters &queryParameters)

Sets the point barriers for a RouteTask by providing a featureTable filtered with queryParameters.

void RouteParameters::setPolygonBarriers(const QList<PolygonBarrier> &polygonBarriers)

Sets the polygonBarriers for a RouteTask by providing a list of PolygonBarrier.

void RouteParameters::setPolygonBarriersWithFeatureTable(ArcGISFeatureTable *featureTable, const QueryParameters &queryParameters)

Sets the polygon barriers for a RouteTask by providing a featureTable filtered with queryParameters.

void RouteParameters::setPolylineBarriers(const QList<PolylineBarrier> &polylineBarriers)

Sets the polylineBarriers for a RouteTask by providing a list of PolylineBarrier.

void RouteParameters::setPolylineBarriersWithFeatureTable(ArcGISFeatureTable *featureTable, const QueryParameters &queryParameters)

Sets the polyline barriers for a RouteTask by providing a featureTable filtered with queryParameters.

void RouteParameters::setPreserveFirstStop(bool preserveFirstStop)

Sets whether the analysis should preserveFirstStop.

This parameter is applicable only if isFindBestSequence is true.

See also isPreserveFirstStop().

void RouteParameters::setPreserveLastStop(bool preserveLastStop)

Sets whether the analysis should preserveLastStop.

This parameter is applicable only if isFindBestSequence is true.

See also isPreserveLastStop().

void RouteParameters::setReturnDirections(bool returnDirections)

Sets whether to returnDirections with the RouteResult.

See also isReturnDirections().

void RouteParameters::setReturnPointBarriers(bool returnPointBarriers)

Sets whether to returnPointBarriers with the RouteResult.

Reusing the list of PointBarriers from the RouteResult (as opposed to using the original list of PointBarriers) can increase the speed of any subsequent route calculations.

See also isReturnPointBarriers().

void RouteParameters::setReturnPolygonBarriers(bool returnPolygonBarriers)

Sets whether to returnPolygonBarriers with the RouteResult.

Reusing the PolygonBarriers from the RouteResult (as opposed to using the original PolygonBarriers) can increase the speed of any following Route calculations. This is particularly true for complex polygons.

See also isReturnPolygonBarriers().

void RouteParameters::setReturnPolylineBarriers(bool returnPolylineBarriers)

Sets whether to returnPolylineBarriers with the RouteResult.

Reusing the list of PolylineBarriers from the RouteResult (as opposed to using the original PolylineBarriers) can increase the speed of any following Route calculations. This is particularly true for complex polylines.

See also isReturnPolylineBarriers().

void RouteParameters::setReturnRoutes(bool returnRoutes)

Sets whether to returnRoutes with the RouteResult.

See also isReturnRoutes().

void RouteParameters::setReturnStops(bool returnStops)

Sets whether to returnStops with the RouteResult.

See also isReturnStops().

void RouteParameters::setRouteShapeType(RouteShapeType routeShapeType)

Sets the output routeShapeType for a route.

See also routeShapeType().

void RouteParameters::setSearchWhereClause(const QString &sourceName, const QString &searchWhereClause)

Sets the searchWhereClause for the specified sourceName.

This filters the potential matches returned from the task based on an expression.

Note: Search WHERE clauses are not supported for online route tasks. They are only supported when solving local route tasks.

See also searchWhereClause().

void RouteParameters::setStartTime(const QDateTime &startTime)

Sets the startTime of the route in UTC time.

See also startTime().

void RouteParameters::setStops(const QList<Stop> &stops)

Sets the stops for a RouteTask by providing a list of Stop.

A minimum of 2 stops are required to complete a RouteTask.

void RouteParameters::setStopsWithFeatureTable(ArcGISFeatureTable *featureTable, const QueryParameters &queryParameters)

Sets the stops for a RouteTask by providing a featureTable filtered with queryParameters.

void RouteParameters::setTravelMode(const TravelMode &travelMode)

Sets the travelMode.

See also travelMode().

QDateTime RouteParameters::startTime() const

Returns the start time of the route in UTC time.

See also setStartTime().

TravelMode RouteParameters::travelMode() const

Returns the travel mode.

See also setTravelMode().

RouteParameters &RouteParameters::operator=(const RouteParameters &other)

Assignment operator from other RouteParameters.

RouteParameters &RouteParameters::operator=(RouteParameters &&other)

Move operator from other RouteParameters.


Feedback on this topic?