Class TravelMode
- java.lang.Object
-
- com.esri.arcgisruntime.tasks.networkanalysis.TravelMode
-
public final class TravelMode extends java.lang.Object
Represents options that can be used to customize the routes generated byRouteTask
. A default list of travel modes can be obtained by callingRouteTaskInfo.getTravelModes()
. This list comprises the options supported by the underlying network analyst service or transportation network dataset.- Since:
- 100.0.0
-
-
Constructor Summary
Constructors Constructor Description TravelMode()
Creates a travel mode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<AttributeParameterValue>
getAttributeParameterValues()
Gets the attribute parameter values.java.lang.String
getDescription()
Gets the description of this TravelMode.java.lang.String
getDistanceAttributeName()
Gets the name of the attribute that has been set assetImpedanceAttributeName(String)
to optimize routes based on distance travelled.java.lang.String
getImpedanceAttributeName()
Gets the name of the attribute to use as the impedance.java.lang.String
getName()
Gets the name of this TravelMode.double
getOutputGeometryPrecision()
Gets the desired precision (in Meters) of the output route geometry after generalization.java.util.List<java.lang.String>
getRestrictionAttributeNames()
Gets the list of network attribute names to be used as restrictions while computing the route.java.lang.String
getTimeAttributeName()
Gets the name of the attribute that has been set assetImpedanceAttributeName(String)
to optimize routes based on time taken.java.lang.String
getType()
Gets the type of this TravelMode.UTurnPolicy
getUTurnPolicy()
Gets the UTurn policy.boolean
isUseHierarchy()
Gets whether hierarchy of elements in the transportation network should be considered.void
setDescription(java.lang.String description)
Sets the description of this TravelMode.void
setDistanceAttributeName(java.lang.String distanceAttributeName)
Sets the name of the attribute that can be set assetImpedanceAttributeName(String)
to optimize routes based on distance travelled.void
setImpedanceAttributeName(java.lang.String impedanceAttributeName)
Sets the name of the attribute to use as the impedance.void
setName(java.lang.String name)
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(java.lang.String timeAttributeName)
Sets the name of the attribute that can be set assetImpedanceAttributeName(String)
to optimize routes based on time taken.void
setType(java.lang.String type)
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.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of this TravelMode.- Returns:
- the name
- Since:
- 100.0.0
-
setName
public void setName(java.lang.String name)
Sets the name of this TravelMode.- Parameters:
name
- name- Since:
- 100.0.0
-
getDescription
public java.lang.String getDescription()
Gets the description of this TravelMode.- Returns:
- the description
- Since:
- 100.0.0
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of this TravelMode.- Parameters:
description
- description- Since:
- 100.0.0
-
getType
public java.lang.String getType()
Gets the type of this TravelMode.- Returns:
- the type
- Since:
- 100.0.0
-
setType
public void setType(java.lang.String type)
Sets the type of this TravelMode.- Parameters:
type
- type- Since:
- 100.0.0
-
getImpedanceAttributeName
public java.lang.String getImpedanceAttributeName()
Gets the name of the attribute to use as the impedance.- Returns:
- the impedance attribute name
- Since:
- 100.0.0
-
setImpedanceAttributeName
public void setImpedanceAttributeName(java.lang.String impedanceAttributeName)
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
public java.lang.String 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
public void setTimeAttributeName(java.lang.String timeAttributeName)
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
public java.lang.String 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
public void setDistanceAttributeName(java.lang.String distanceAttributeName)
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
public java.util.List<java.lang.String> 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
public java.util.List<AttributeParameterValue> 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
public UTurnPolicy getUTurnPolicy()
Gets the UTurn policy.- Returns:
- the UTurn policy
- Since:
- 100.0.0
-
setUTurnPolicy
public void setUTurnPolicy(UTurnPolicy uturnPolicy)
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:
- https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/network-analysis-with-hierarchy.htm
-
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
-
-