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 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 Details Link icon

    • TravelMode Link icon

      public TravelMode()
      Creates a travel mode.
      Since:
      100.4.0
  • Method Details Link icon

    • getName Link icon

      public String getName()
      Gets the name of this TravelMode.
      Returns:
      the name
      Since:
      100.0.0
    • setName Link icon

      public void setName(String name)
      Sets the name of this TravelMode.
      Parameters:
      name - name
      Since:
      100.0.0
    • getDescription Link icon

      public String getDescription()
      Gets the description of this TravelMode.
      Returns:
      the description
      Since:
      100.0.0
    • setDescription Link icon

      public void setDescription(String description)
      Sets the description of this TravelMode.
      Parameters:
      description - description
      Since:
      100.0.0
    • getType Link icon

      public String getType()
      Gets the type of this TravelMode.
      Returns:
      the type
      Since:
      100.0.0
    • setType Link icon

      public void setType(String type)
      Sets the type of this TravelMode.
      Parameters:
      type - type
      Since:
      100.0.0
    • getImpedanceAttributeName Link icon

      public String getImpedanceAttributeName()
      Gets the name of the attribute to use as the impedance.
      Returns:
      the impedance attribute name
      Since:
      100.0.0
    • setImpedanceAttributeName Link icon

      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, use setTimeAttributeName(String). To minimize distance travelled by the route, use setDistanceAttributeName(String). You can also use other attributes that are available in RouteTaskInfo.getCostAttributes() as the impedance.
      Parameters:
      impedanceAttributeName - impedance attribute name
      Since:
      100.0.0
    • getTimeAttributeName Link icon

      public String getTimeAttributeName()
      Gets the name of the attribute that has been set as setImpedanceAttributeName(String) to optimize routes based on time taken.
      Returns:
      the time attribute name
      Since:
      100.0.0
    • setTimeAttributeName Link icon

      public void setTimeAttributeName(String timeAttributeName)
      Sets the name of the attribute that can be set as setImpedanceAttributeName(String) to optimize routes based on time taken.
      Parameters:
      timeAttributeName - time attribute name
      Since:
      100.0.0
    • getDistanceAttributeName Link icon

      public String getDistanceAttributeName()
      Gets the name of the attribute that has been set as setImpedanceAttributeName(String) to optimize routes based on distance travelled.
      Returns:
      the distance attribute name
      Since:
      100.0.0
    • setDistanceAttributeName Link icon

      public void setDistanceAttributeName(String distanceAttributeName)
      Sets the name of the attribute that can be set as setImpedanceAttributeName(String) to optimize routes based on distance travelled.
      Parameters:
      distanceAttributeName - distance attribute name
      Since:
      100.0.0
    • getRestrictionAttributeNames Link icon

      public List<String> getRestrictionAttributeNames()
      Gets the list of network attribute names to be used as restrictions while computing the route. Possible values are specified in RouteTaskInfo.getRestrictionAttributes().
      Returns:
      the restriction attribute names
      Since:
      100.0.0
    • getAttributeParameterValues Link icon

      public List<AttributeParameterValue> getAttributeParameterValues()
      Gets the attribute parameter values. Overrides to the attribute values of a cost attribute specified in getImpedanceAttributeName(), or to the attribute values of a restriction attribute specified in getRestrictionAttributeNames().

      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 Link icon

      public UTurnPolicy getUTurnPolicy()
      Gets the UTurn policy.
      Returns:
      the UTurn policy
      Since:
      100.0.0
    • setUTurnPolicy Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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