java.lang.Object
com.esri.arcgisruntime.tasks.networkanalysis.TravelMode
Represents options that can be used to customize the routes generated by
RouteTask
.
A default list of travel modes can be obtained by calling RouteTaskInfo.getTravelModes()
. This list
comprises the options supported by the underlying network analyst service or transportation network dataset.- Since:
- 100.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the attribute parameter values.Gets the description of this TravelMode.Gets the name of the attribute that has been set assetImpedanceAttributeName(String)
to optimize routes based on distance travelled.Gets the name of the attribute to use as the impedance.getName()
Gets the name of this TravelMode.double
Gets the desired precision (in Meters) of the output route geometry after generalization.Gets the list of network attribute names to be used as restrictions while computing the route.Gets the name of the attribute that has been set assetImpedanceAttributeName(String)
to optimize routes based on time taken.getType()
Gets the type of this TravelMode.Gets the UTurn policy.boolean
Gets whether hierarchy of elements in the transportation network should be considered.void
setDescription
(String description) Sets the description of this TravelMode.void
setDistanceAttributeName
(String distanceAttributeName) Sets the name of the attribute that can be set assetImpedanceAttributeName(String)
to optimize routes based on distance travelled.void
setImpedanceAttributeName
(String impedanceAttributeName) Sets the name of the attribute to use as the impedance.void
Sets the name of this TravelMode.void
setOutputGeometryPrecision
(double outputGeometryPrecision) Sets the desired precision (in Meters) of the output route geometry after generalization.void
setTimeAttributeName
(String timeAttributeName) Sets the name of the attribute that can be set assetImpedanceAttributeName(String)
to optimize routes based on time taken.void
Sets the type of this TravelMode.void
setUseHierarchy
(boolean useHierarchy) Sets whether hierarchy of elements in the transportation network should be considered.void
setUTurnPolicy
(UTurnPolicy uturnPolicy) Sets the UTurn policy.
-
Constructor Details
-
TravelMode
public TravelMode()Creates a travel mode.- Since:
- 100.4.0
-
-
Method Details
-
getName
Gets the name of this TravelMode.- Returns:
- the name
- Since:
- 100.0.0
-
setName
Sets the name of this TravelMode.- Parameters:
name
- name- Since:
- 100.0.0
-
getDescription
Gets the description of this TravelMode.- Returns:
- the description
- Since:
- 100.0.0
-
setDescription
Sets the description of this TravelMode.- Parameters:
description
- description- Since:
- 100.0.0
-
getType
Gets the type of this TravelMode.- Returns:
- the type
- Since:
- 100.0.0
-
setType
Sets the type of this TravelMode.- Parameters:
type
- type- Since:
- 100.0.0
-
getImpedanceAttributeName
Gets the name of the attribute to use as the impedance.- Returns:
- the impedance attribute name
- Since:
- 100.0.0
-
setImpedanceAttributeName
Sets the name of the attribute to use as the impedance. Routes will be optimized in order to minimize this impedance along the route. To minimize time taken by the route, usesetTimeAttributeName(String)
. To minimize distance travelled by the route, usesetDistanceAttributeName(String)
. You can also use other attributes that are available inRouteTaskInfo.getCostAttributes()
as the impedance.- Parameters:
impedanceAttributeName
- impedance attribute name- Since:
- 100.0.0
-
getTimeAttributeName
Gets the name of the attribute that has been set assetImpedanceAttributeName(String)
to optimize routes based on time taken.- Returns:
- the time attribute name
- Since:
- 100.0.0
-
setTimeAttributeName
Sets the name of the attribute that can be set assetImpedanceAttributeName(String)
to optimize routes based on time taken.- Parameters:
timeAttributeName
- time attribute name- Since:
- 100.0.0
-
getDistanceAttributeName
Gets the name of the attribute that has been set assetImpedanceAttributeName(String)
to optimize routes based on distance travelled.- Returns:
- the distance attribute name
- Since:
- 100.0.0
-
setDistanceAttributeName
Sets the name of the attribute that can be set assetImpedanceAttributeName(String)
to optimize routes based on distance travelled.- Parameters:
distanceAttributeName
- distance attribute name- Since:
- 100.0.0
-
getRestrictionAttributeNames
Gets the list of network attribute names to be used as restrictions while computing the route. Possible values are specified inRouteTaskInfo.getRestrictionAttributes()
.- Returns:
- the restriction attribute names
- Since:
- 100.0.0
-
getAttributeParameterValues
Gets the attribute parameter values. Overrides to the attribute values of a cost attribute specified ingetImpedanceAttributeName()
, or to the attribute values of a restriction attribute specified ingetRestrictionAttributeNames()
.Example:
AttributeParameterValue attributeParameterValue = new AttributeParameterValue(); attributeParameterValue.setAttributeName("Height Restriction"); attributeParameterValue.setParameterName("Vehicle Height (meters)"); attributeParameterValue.setParameterValue(100); getAttributeParameterValues().add(attributeParameterValue);
- Returns:
- the attribute parameter values.
- Since:
- 100.0.0
-
getUTurnPolicy
Gets the UTurn policy.- Returns:
- the UTurn policy
- Since:
- 100.0.0
-
setUTurnPolicy
Sets the UTurn policy. Specifies how U-Turns should be handled. U-turns can be allowed everywhere, nowhere, only at dead ends, or only at intersections and dead ends. Allowing U-turns implies the vehicle can turn around at a junction and double back on the same street.- Parameters:
uturnPolicy
- UTurn policy- Since:
- 100.0.0
-
isUseHierarchy
public boolean isUseHierarchy()Gets whether hierarchy of elements in the transportation network should be considered.- Returns:
- the whether to use hierarchy
- Since:
- 100.0.0
-
setUseHierarchy
public void setUseHierarchy(boolean useHierarchy) Sets whether hierarchy of elements in the transportation network should be considered. A hierarchical solve tends to prefer higher-order streets such a freeways.- Parameters:
useHierarchy
- whether to use hierarchy- Since:
- 100.0.0
- See Also:
-
getOutputGeometryPrecision
public double getOutputGeometryPrecision()Gets the desired precision (in Meters) of the output route geometry after generalization.- Returns:
- the output geometry precision in meters
- Since:
- 100.0.0
-
setOutputGeometryPrecision
public void setOutputGeometryPrecision(double outputGeometryPrecision) Sets the desired precision (in Meters) of the output route geometry after generalization.- Parameters:
outputGeometryPrecision
- output geometry precision in meters- Since:
- 100.0.0
-