Packagecom.esri.ags.tasks.supportClasses
Classpublic class RouteParameters
InheritanceRouteParameters Inheritance Object

Since : ArcGIS API for Flex 1.2

Input parameters for a RouteTask.

Note: RouteParameters, and other routing related classes, were added in version 1.2 and requires ArcGIS Server 9.3.1 or above and a "route" layer. A "route" layer is a layer of type "esriNAServerRouteLayer".

If you don't specify any barriers, the server will use the predefined barriers from the server. To use neither the predefined barriers, nor any user-defined ones, set the pointBarriers, polylineBarriers and polygonBarriers to empty arrays. The same applies to stops.

View the examples

See also

com.esri.ags.tasks.RouteTask
Barriers in Network Analysis [ArcGIS Help]
Live sample - Basic routing.
Live sample - Routing with driving directions.


Public Properties
 PropertyDefined By
  accumulateAttributes : Array
The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response.
RouteParameters
  attributeParameterValues : Array
A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle.
RouteParameters
  directionsLanguage : String
The language to be used when computing directions.
RouteParameters
  directionsLengthUnits : String
The length units to use when computing directions.
RouteParameters
  directionsOutputType : String
Defines content, verbosity of returned directions.
RouteParameters
  directionsTimeAttribute : String
The name of network attribute to use for the drive time when computing directions.
RouteParameters
  doNotLocateOnRestrictedElements : Boolean = true
If true, avoid network elements restricted by barriers or due to restrictions specified in restrictionAttributes.
RouteParameters
  findBestSequence : Boolean
If true, the solver will optimize the order of the stops in the route (while taking into account preserveFirstStop and preserveLastStop if they were set to true).
RouteParameters
  ignoreInvalidLocations : Boolean
When false, the solve operation will fail if at least one of the stops specified cannot be located or reached.
RouteParameters
  impedanceAttribute : String
The network attribute name to be used as the impedance attribute in analysis.
RouteParameters
  outputGeometryPrecision : Number
The precision of the output geometry after generalization.
RouteParameters
  outputGeometryPrecisionUnits : String
The units of the output geometry precision.
RouteParameters
  outputLines : String
The type of output lines to be generated in the result.
RouteParameters
  outSpatialReference : SpatialReference
The well-known ID of the spatial reference for the geometries returned with the analysis results.
RouteParameters
  pointBarriers : Object
The set of point barrier loaded as network locations during analysis.
RouteParameters
  polygonBarriers : Object
The set of polygon barrier loaded as network locations during analysis.
RouteParameters
  polylineBarriers : Object
The set of polyline barrier loaded as network locations during analysis.
RouteParameters
  preserveFirstStop : Boolean
If true, the solver should keep the first stop fixed in the sequence (even when findBestSequence is true).
RouteParameters
  preserveLastStop : Boolean
If true, the solver should keep the last stop fixed in the sequence (even when findBestSequence is true).
RouteParameters
  restrictionAttributes : Array
The list of network attribute names to be used as restrictions with the analysis.
RouteParameters
  restrictUTurns : String
Specifies how U-turns should be handled.
RouteParameters
  returnDirections : Boolean = false
If true, directions will be generated and returned in the directions property of each RouteResult of the RouteSolveResult.
RouteParameters
  returnPointBarriers : Boolean = false
If true, point barriers will be returned in the pointBarriers property of RouteSolveResult.
RouteParameters
  returnPolygonBarriers : Boolean = false
If true, polygon barriers will be returned in the polygonBarriers property of RouteSolveResult.
RouteParameters
  returnPolylineBarriers : Boolean = false
If true, polyline barriers will be returned in the polylineBarriers property of RouteSolveResult.
RouteParameters
  returnRoutes : Boolean = true
If true, routes will be generated and returned in the route property of each RouteResult of the RouteSolveResult.
RouteParameters
  returnStops : Boolean = false
If true, stops will be returned in the stops property of RouteSolveResult.
RouteParameters
  returnZ : Boolean = false
If true, Z values will be included in the results if the features have Z values.
RouteParameters
  startTime : Date
The time the route begins.
RouteParameters
  stops : Object
The set of stops loaded as network locations during analysis.
RouteParameters
  useHierarchy : Boolean
If true, the hierarchy attribute for the network should be used in analysis.
RouteParameters
  useTimeWindows : Boolean
If true, the solver should consider time windows.
RouteParameters
Property Detail
accumulateAttributesproperty
public var accumulateAttributes:Array

The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response. The default is as defined in the specific routing network layer used in your RouteTask. You can specify any attributes names listed in the Service Directory under "Network Dataset -> Network Attributes" as "Usage Type: esriNAUTCost".

See also

attributeParameterValuesproperty 
public var attributeParameterValues:Array

A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle. The parameter holding a vehicle characteristic is compared to a value coming from a descriptor attribute to determine whether or not a network element is traversable. For example, a parameterized restriction attribute can compare the height of your vehicle with a descriptor attribute that holds the clearance under overpasses through tunnels. If the vehicles height is greater than the clearance, the edge is restricted. Parameterized cost attributes that can reference other cost attributes and scale them, can also be used. This is useful when inclement weather like ice, fog or heavy rain, descends on the study area and hinders normal flow of traffic. By having a parameter already outfitted on a cost attribute, travel-time expectations and traversable network paths can be adjusted with respect to changes in traffic speeds.

directionsLanguageproperty 
public var directionsLanguage:String

The language to be used when computing directions. The default is as defined in the specific routing network layer used in your RouteTask. By default, NAServer gets installed with en_US only - it is up to the server administrator to add additional languages.

directionsLengthUnitsproperty 
public var directionsLengthUnits:String

The length units to use when computing directions. The default is as defined in the specific routing network layer used in your RouteTask. Possible values are "esriFeet", "esriKilometers", "esriMeters", "esriMiles", "esriNauticalMiles" and "esriYards".

directionsOutputTypeproperty 
public var directionsOutputType:String

Since : ArcGIS API 3.2 for Flex

Defines content, verbosity of returned directions. Possible values are "esriDOTComplete", "esriDOTCompleteNoEvents", "esriDOTInstructionsOnly", "esriDOTStandard" and "esriDOTSummaryOnly".

directionsTimeAttributeproperty 
public var directionsTimeAttribute:String

The name of network attribute to use for the drive time when computing directions. The default is as defined in the specific routing network layer used in your RouteTask.

doNotLocateOnRestrictedElementsproperty 
public var doNotLocateOnRestrictedElements:Boolean = true

If true, avoid network elements restricted by barriers or due to restrictions specified in restrictionAttributes.

The default value is true.

findBestSequenceproperty 
findBestSequence:Boolean

If true, the solver will optimize the order of the stops in the route (while taking into account preserveFirstStop and preserveLastStop if they were set to true). The default is as defined in the specific routing network layer used in your RouteTask.


Implementation
    public function get findBestSequence():Boolean
    public function set findBestSequence(value:Boolean):void
ignoreInvalidLocationsproperty 
ignoreInvalidLocations:Boolean

When false, the solve operation will fail if at least one of the stops specified cannot be located or reached. If true, invalid locations are ignored and route(s) will be returned as long as there are at least two valid stops that have been connected by a route. If multiple routes are processed in a single request a valid result will be returned as long as least one route is built. The list of routes that cannot be solved is included in RouteSolveResult.messages property.


Implementation
    public function get ignoreInvalidLocations():Boolean
    public function set ignoreInvalidLocations(value:Boolean):void
impedanceAttributeproperty 
public var impedanceAttribute:String

The network attribute name to be used as the impedance attribute in analysis. The default is as defined in the specific routing network layer used in your RouteTask. You can specify any attributes names listed in the Service Directory under "Network Dataset -> Network Attributes" as "Usage Type: esriNAUTCost". You can also specify a value of "none" to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service.

For example, set impedanceAttribute="Time" for quickest route and impedanceAttribute="Length" for shortest drive. Assuming the service has those two esriNAUTCost attributes.

See also

outputGeometryPrecisionproperty 
public var outputGeometryPrecision:Number

The precision of the output geometry after generalization. If 0, no generalization of output geometry is performed. If present and positive, it represents the MaximumAllowableOffset parameter - generalization is performed according to IPolycurve.Generalize.

outputGeometryPrecisionUnitsproperty 
public var outputGeometryPrecisionUnits:String

The units of the output geometry precision.

The default value is esriUnknownUnits.

outputLinesproperty 
public var outputLines:String

The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your RouteTask. Possible values are "esriNAOutputLineNone" (no line at all), "esriNAOutputLineStraight" (a straight line from start to end),"esriNAOutputLineTrueShape" and "esriNAOutputLineTrueShapeWithMeasure" (added in version 3.0).

See also

outSpatialReferenceproperty 
public var outSpatialReference:SpatialReference

The well-known ID of the spatial reference for the geometries returned with the analysis results. If outSR is not specified, the geometries are returned in the spatial reference of the map.

pointBarriersproperty 
public var pointBarriers:Object

The set of point barrier loaded as network locations during analysis. Can be either an instance of DataLayer or FeatureSet or a "url" (added in version 3.0). The url value contains a REST Query request to a Feature, Map or a GP service returning a JSON featureset and requires ArcGIS 10.1 or higher.

Note: this property was known in version 1.x as "barriers".

See also

polygonBarriersproperty 
public var polygonBarriers:Object

The set of polygon barrier loaded as network locations during analysis. Can be either an instance of DataLayer or FeatureSet or a "url" (added in version 3.0). The url value contains a REST Query request to a Feature, Map or a GP service returning a JSON featureset and requires ArcGIS Server 10.l or higher.

Note: polyline and polygon barriers require ArcGIS Server 10.0 or above (only point barriers was supported earlier).

See also

polylineBarriersproperty 
public var polylineBarriers:Object

The set of polyline barrier loaded as network locations during analysis. Can be either an instance of DataLayer or FeatureSet or a "url" (added in version 3.0). The url value contains a REST Query request to a Feature, Map or a GP service returning a JSON featureset and requires ArcGIS Server 10.l or higher.

Note: polyline and polygon barriers require ArcGIS Server 10.0 or above (only point barriers was supported earlier).

See also

preserveFirstStopproperty 
preserveFirstStop:Boolean

If true, the solver should keep the first stop fixed in the sequence (even when findBestSequence is true). Only applicable if findBestSequence is true. The default is as defined in the specific routing network layer used in your RouteTask.


Implementation
    public function get preserveFirstStop():Boolean
    public function set preserveFirstStop(value:Boolean):void
preserveLastStopproperty 
preserveLastStop:Boolean

If true, the solver should keep the last stop fixed in the sequence (even when findBestSequence is true). Only applicable if findBestSequence is true. The default is as defined in the specific routing network layer used in your RouteTask.


Implementation
    public function get preserveLastStop():Boolean
    public function set preserveLastStop(value:Boolean):void
restrictionAttributesproperty 
public var restrictionAttributes:Array

The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your RouteTask. Possible values are listed in the Service Directory under "Network Dataset -> Network Attributes". You can also specify a value of "none" to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service.


Example
ActionScript to use restrictionAttributes:
     myRouteParams.restrictionAttributes = ["OneWay"];
ActionScript to not use the service defaults for restrictions:
     myRouteParams.restrictionAttributes = ["none"];
restrictUTurnsproperty 
public var restrictUTurns:String

Specifies how U-turns should be handled. The default is as defined in the specific routing network layer used in your RouteTask. Possible values are "esriNFSBAllowBacktrack", "esriNFSBAtDeadEndsOnly", "esriNFSBNoBacktrack" and "esriNFSBAtDeadEndsAndIntersections".

See also

returnDirectionsproperty 
public var returnDirections:Boolean = false

If true, directions will be generated and returned in the directions property of each RouteResult of the RouteSolveResult.

The default value is false.

See also

returnPointBarriersproperty 
public var returnPointBarriers:Boolean = false

If true, point barriers will be returned in the pointBarriers property of RouteSolveResult.

Note: this property was known in version 1.x as "returnBarriers".

The default value is false.

See also

returnPolygonBarriersproperty 
public var returnPolygonBarriers:Boolean = false

If true, polygon barriers will be returned in the polygonBarriers property of RouteSolveResult.

Note: polyline and polygon barriers require ArcGIS Server 10.0 or above (only point barriers was supported earlier).

The default value is false.

See also

returnPolylineBarriersproperty 
public var returnPolylineBarriers:Boolean = false

If true, polyline barriers will be returned in the polylineBarriers property of RouteSolveResult.

Note: polyline and polygon barriers require ArcGIS Server 10.0 or above (only point barriers was supported earlier).

The default value is false.

See also

returnRoutesproperty 
public var returnRoutes:Boolean = true

If true, routes will be generated and returned in the route property of each RouteResult of the RouteSolveResult.

The default value is true.

See also

returnStopsproperty 
public var returnStops:Boolean = false

If true, stops will be returned in the stops property of RouteSolveResult.

The default value is false.

See also

returnZproperty 
public var returnZ:Boolean = false

Since : ArcGIS API 3.0 for Flex

If true, Z values will be included in the results if the features have Z values. Otherwise Z values are not returned.

The default value is false.

startTimeproperty 
public var startTime:Date

The time the route begins. If not specified, the solver will not start the route at a particular time. The time should be specified as a numeric value representing the milliseconds since midnight January 1, 1970. It can be a negative number.You can also specify a value of none to indicate that a start time should not be used.

stopsproperty 
public var stops:Object

The set of stops loaded as network locations during analysis. Can be either an instance of DataLayer or FeatureSet or a "url" (added in version 3.0). The url value contains a REST Query request to a Feature, Map or a GP service returning a JSON featureset and requires ArcGIS Server 10.l or higher.

To do batch routing (solving multiple routes at once), add route names to each of your stops.

See also

useHierarchyproperty 
useHierarchy:Boolean

If true, the hierarchy attribute for the network should be used in analysis. The default is as defined in the specific routing network layer used in your RouteTask.


Implementation
    public function get useHierarchy():Boolean
    public function set useHierarchy(value:Boolean):void
useTimeWindowsproperty 
useTimeWindows:Boolean

If true, the solver should consider time windows. The default is as defined in the specific routing network layer used in your RouteTask.


Implementation
    public function get useTimeWindows():Boolean
    public function set useTimeWindows(value:Boolean):void
Examples
ActionScript to use RouteParameters:
 <esri:RouteParameters id="routeParams" stops="{stops}"/>
MXML to use RouteParameters:
 <esri:RouteParameters id="routeParams"
    stops="{stopsFS}"
    returnRoutes="false"
    returnDirections="true"
    directionsLengthUnits="esriMiles"
    outSpatialReference="{myMap.spatialReference}"/>