Defines how a pedestrian, car, truck or other mode of transportation moves through the network. More...
Header: | #include <TravelMode.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Public Functions
TravelMode() | |
TravelMode(const Esri::ArcGISRuntime::TravelMode &other) | |
TravelMode(Esri::ArcGISRuntime::TravelMode &&other) | |
~TravelMode() | |
QList<Esri::ArcGISRuntime::AttributeParameterValue> | attributeParameterValues() const |
QString | description() const |
QString | distanceAttributeName() const |
QString | impedanceAttributeName() const |
bool | isEmpty() const |
bool | isUseHierarchy() const |
QString | name() const |
double | outputGeometryPrecision() const |
QStringList | restrictionAttributeNames() const |
void | setAttributeParameterValues(const QList<Esri::ArcGISRuntime::AttributeParameterValue> &attributeParameterValues) |
void | setDescription(const QString &description) |
void | setDistanceAttributeName(const QString &distanceAttributeName) |
void | setImpedanceAttributeName(const QString &impedanceAttributeName) |
void | setName(const QString &name) |
void | setOutputGeometryPrecision(double outputGeometryPrecision) |
void | setRestrictionAttributeNames(const QStringList &restrictionAttributeNames) |
void | setTimeAttributeName(const QString &timeAttributename) |
void | setType(const QString &type) |
void | setUTurnPolicy(Esri::ArcGISRuntime::UTurnPolicy uTurnPolicy) |
void | setUseHierarchy(bool useHierarchy) |
QString | timeAttributeName() const |
QString | type() const |
Esri::ArcGISRuntime::UTurnPolicy | uTurnPolicy() const |
Esri::ArcGISRuntime::TravelMode & | operator=(const Esri::ArcGISRuntime::TravelMode &other) |
Esri::ArcGISRuntime::TravelMode & | operator=(Esri::ArcGISRuntime::TravelMode &&other) |
Detailed Description
A travel mode consists of a collection of network dataset settings that define actions that are allowed on the network and how the actions can be performed. Selecting a predefined travel mode allows you to efficiently and consistently set a number of properties that are appropriate for the mode of travel you intend to model. Since a travel mode is a collection of properties that work together it is recommended to have a full understanding of how these properties interact before altering them on the fly for a particular analysis. A best practice would be to create a new travel mode in the network dataset in ArcGIS Desktop or ArcGIS Pro that is fully tested to ensure that is returns the required solution.
Set the TravelMode in the RouteParameters that you are using with your RouteTask.
Relevant samples:
- Offline routing: This sample demonstrates how to solve a route on-the-fly using offline data.
See also Travel modes.
Member Function Documentation
TravelMode::TravelMode ()
Default constructor.
TravelMode::TravelMode (const Esri::ArcGISRuntime::TravelMode &other)
Copy constructor from other TravelMode.
TravelMode::TravelMode (Esri::ArcGISRuntime::TravelMode &&other)
Move constructor from other TravelMode.
TravelMode::~TravelMode ()
Destructor.
QList<Esri::ArcGISRuntime::AttributeParameterValue > TravelMode::attributeParameterValues () const
Returns the attribute parameter values of this TravelMode.
See also setAttributeParameterValues().
QString TravelMode::description() const
Returns the short text description of the TravelMode.
See also setDescription().
QString TravelMode::distanceAttributeName () const
Returns the distance attribute name of this TravelMode.
Specifies the distance-based cost attribute for reporting directions, total length.
See also setDistanceAttributeName().
QString TravelMode::impedanceAttributeName () const
Returns the impedance attribute name of this TravelMode.
Gets the impedance attribute (i.e. the cost attribute to be minimized on solve). For example: "TravelTime" or "Distance".
See also setImpedanceAttributeName().
bool TravelMode::isEmpty () const
Returns true
if this TravelMode is empty.
bool TravelMode::isUseHierarchy () const
Returns true
if hierarchy is used.
Indicates whether the travel mode uses the network hierarchy in an analysis.
QString TravelMode::name() const
Returns the unique name of the TravelMode.
See also setName().
double TravelMode::outputGeometryPrecision () const
Returns the output geometry precision of this TravelMode in meters.
See also setOutputGeometryPrecision().
QStringList TravelMode::restrictionAttributeNames () const
Returns the restriction attribute names of this TravelMode.
Indicates the restriction attributes that are respected during solve.
See also setRestrictionAttributeNames().
void TravelMode::setAttributeParameterValues (const QList<Esri::ArcGISRuntime::AttributeParameterValue > &attributeParameterValues )
Sets the attributeParameterValues of this TravelMode.
The following are examples of attribute parameter values: Vehicle Weight, Vehicle Height, and so on. Attribute parameter values are useful for customizing individual restrictions (such as "Don't travel on roads with weight limits below 6 tons").
See also attributeParameterValues().
void TravelMode::setDescription (const QString &description)
Sets the short text description of the TravelMode.
See also description().
void TravelMode::setDistanceAttributeName (const QString &distanceAttributeName )
Sets the distanceAttributeName of this TravelMode.
Specifies the distance-based cost attribute for reporting directions, total length.
See also distanceAttributeName().
void TravelMode::setImpedanceAttributeName (const QString &impedanceAttributeName )
Sets the impedanceAttributeName of this TravelMode.
Sets the impedance attribute (i.e. the cost attribute to be minimized on solve). For example: "TravelTime" or "Distance".
See also impedanceAttributeName().
void TravelMode::setName (const QString &name)
Sets the unique name of the TravelMode.
See also name().
void TravelMode::setOutputGeometryPrecision (double outputGeometryPrecision )
Sets the output geometry precision of this TravelMode to outputGeometryPrecision meters.
This controls the degree to which the travel mode generalizes the geometry of the analysis. Having more generalization could result in a faster result, but will show less detail. It is important to consider the type of TravelMode when setting this value. For example, a pedestrian walking would likely require more precise geometries to follow than an automobile traveling down a highway.
See also outputGeometryPrecision().
void TravelMode::setRestrictionAttributeNames (const QStringList &restrictionAttributeNames )
Sets the restrictionAttributeNames of this TravelMode.
Indicates the restriction attributes that are respected during solve.
See also restrictionAttributeNames().
void TravelMode::setTimeAttributeName (const QString &timeAttributename )
Sets the timeAttributename of this TravelMode.
Specifies the time-based cost attribute for reporting directions, total time, travel time and wait or late times.
See also timeAttributeName().
void TravelMode::setType (const QString &type)
Sets this TravelMode's type.
Travel mode type is a string value that has one of four types (assuming that the underlying network was created through the UI of ArcMap). These string values are:
- "AUTOMOBILE"
- "TRUCK"
- "WALK"
- "OTHER
These are meant to provide a way for an app to pair an icon with a mode. For example, Esri's Navigator for ArcGIS uses these mode types to pair a car/truck/pedestrian icon with the mode in a list.
Additionally the mode type can be used to provide hints to the underlying task. For example, if a mode is "WALK", then a route will not be created if the envelope of its stops are larger than 50 miles (either height or width).
There is also the option of creating a custom type, and setting it to any string.
See also type().
void TravelMode::setUTurnPolicy (Esri::ArcGISRuntime::UTurnPolicy uTurnPolicy )
Sets the uTurnPolicy of this TravelMode.
Indicates where the travel mode is allowed to make U-turns.
See also uTurnPolicy().
void TravelMode::setUseHierarchy (bool useHierarchy )
Sets whether to useHierarchy.
Indicates whether the travel mode uses the network hierarchy in an analysis.
See also isUseHierarchy().
QString TravelMode::timeAttributeName () const
Returns the time attribute name of this TravelMode.
Specifies the time-based cost attribute for reporting directions, total time, travel time and wait or late times.
See also setTimeAttributeName().
QString TravelMode::type() const
Returns this TravelMode's type.
Indicates the category of travel or vehicle represented by the travel mode.
See also setType().
Esri::ArcGISRuntime::UTurnPolicy TravelMode::uTurnPolicy () const
Returns the UTurnPolicy of this TravelMode.
Indicates where the travel mode is allowed to make U-turns.
See also setUTurnPolicy().
Esri::ArcGISRuntime::TravelMode &TravelMode::operator=(const Esri::ArcGISRuntime::TravelMode &other)
Assignment operator from other TravelMode.
Esri::ArcGISRuntime::TravelMode &TravelMode::operator=(Esri::ArcGISRuntime::TravelMode &&other)
Move operator from other TravelMode.