Class 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 Detail

      • TravelMode

        public TravelMode()
        Creates a travel mode.
        Since:
        100.4.0
    • 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, 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

        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

        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

        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

        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

        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

        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

        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
      • 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