Class TravelMode
- java.lang.Object
-
- com.esri.arcgisruntime.tasks.networkanalysis.TravelMode
-
public final class TravelMode extends 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 List<AttributeParameterValue>
getAttributeParameterValues()
Gets the attribute parameter values.String
getDescription()
Gets the description of this TravelMode.String
getDistanceAttributeName()
Gets the name of the attribute that has been set assetImpedanceAttributeName(String)
to optimize routes based on distance travelled.String
getImpedanceAttributeName()
Gets the name of the attribute to use as the impedance.String
getName()
Gets the name of this TravelMode.double
getOutputGeometryPrecision()
Gets the desired precision (in Meters) of the output route geometry after generalization.List<String>
getRestrictionAttributeNames()
Gets the list of network attribute names to be used as restrictions while computing the route.String
getTimeAttributeName()
Gets the name of the attribute that has been set assetImpedanceAttributeName(String)
to optimize routes based on time taken.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(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
setName(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(String timeAttributeName)
Sets the name of the attribute that can be set assetImpedanceAttributeName(String)
to optimize routes based on time taken.void
setType(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 String getName()
Gets the name of this TravelMode.- Returns:
- the name
- Since:
- 100.0.0
-
setName
public void setName(String name)
Sets the name of this TravelMode.- Parameters:
name
- name- Since:
- 100.0.0
-
getDescription
public String getDescription()
Gets the description of this TravelMode.- Returns:
- the description
- Since:
- 100.0.0
-
setDescription
public void setDescription(String description)
Sets the description of this TravelMode.- Parameters:
description
- description- Since:
- 100.0.0
-
getType
public String getType()
Gets the type of this TravelMode.- Returns:
- the type
- Since:
- 100.0.0
-
setType
public void setType(String type)
Sets the type of this TravelMode.- Parameters:
type
- type- Since:
- 100.0.0
-
getImpedanceAttributeName
public 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(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 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(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 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(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 List<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 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
-
-