Class: RouteParametersE-mail This Topic Printable Version Give Us Feedback

Description

Class added v1.4.

Input parameters for a RouteTask.

Class hierarchy

esri.tasks.RouteParameters

Constructor

Constructor Description
esri.tasks.RouteParameters() Creates a new RouteParameters object.

Properties

Property Type Description
accumulateAttributes String[] The list of network attribute names to be accumulated with the analysis, i.e. which attributes should be returned as part of the response.
barriers Object The set of barriers loaded as network locations during analysis.
directionsLanguage String The language used when computing directions.
directionsLengthUnits String The length units to use when computing directions.
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.
doNotLocateOnRestrictedElements Boolean If true, avoids network elements restricted by barriers or due to restrictions specified in restrictionAttributes.
findBestSequence Boolean If true, optimizes the order of the stops in the route while taking into account preserveFirstStop and preserveLastStop, if they are set to true.
ignoreInvalidLocations Boolean In routes where a stop is not located on a network or a stop could not be reached, the results will differ depending on the value of ignoreInvalidLocations.

  • When false, the solve operation will fail if at least one of the stops specified cannot be located or reached.
  • When true, as long as there are at least two valid stops that have been connected by a route, a valid result is returned. If multiple routes are processed in a single request, as long as least one route is built, a valid result is returned. The list of routes that cannot be solved is included in the message parameter of RouteTask.onSolveComplete.
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.
outputGeometryPrecision Number The precision of the output geometry after generalization.
outputGeometryPrecisionUnits String The units of the output geometry precision.
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. For possible values, see NAOutputLine.
outSpatialReference SpatialReference The well-known ID of the spatial reference for the geometries returned with the analysis results. If not specified, the geometries are returned in the spatial reference of the map.
preserveFirstStop Boolean If true, keeps the first stop fixed in the sequence even when findBestSequence is true. Only applicable if findBestSequence is true.
preserveLastStrop Boolean If true, keeps the last stop fixed in the sequence even when findBestSequence is true. Only applicable if findBestSequence is true.
restrictionAttributes String[] The list of network attribute names to be used as restrictions with the analysis.
restrictUTurns String Specifies how U-Turns should be handled.
returnBarriers Boolean If true, barriers are returned as the second parameter of RouteTask.onSolveComplete.
returnDirections Boolean If true, directions are generated and returned in the directions property of each RouteResult. For more information, see Getting driving directions.
returnRoutes Boolean If true, routes are generated and returned in the route property of each RouteResult.
returnStops Boolean If true, stops are returned in the stops property of each RouteResult.
startTime Date The time the route begins. If not specified, the default is the time specified in the route service.
stops Object The set of stops loaded as network locations during analysis.
useHierarchy Boolean If true, the hierarchy attribute for the network should be used in analysis.
useTimeWindows Boolean If true, time windows should be used in the analysis.
Constructor Detail

esri.tasks.RouteParameters()

Creates a new RouteParameters object.
Properties Detail

<String[]> accumulateAttributes

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 Understanding the network attribute.

<Object> barriers

The set of barriers loaded as network locations during analysis. Can be either an instance of DataLayer or FeatureSet.

<String> directionsLanguage

The language 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.

<String> directionsLengthUnits

The length units to use when computing directions. The default is as defined in the specific routing network layer used in your RouteTask.
Known values: esriFeet | esriKilometers | esriMeters | esriMiles | esriNauticalMiles | esriYards

<String> directionsTimeAttribute

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.

<Boolean> doNotLocateOnRestrictedElements

If true, avoids network elements restricted by barriers or due to restrictions specified in restrictionAttributes.
Known values: true | false
Default value: false
See also:
barriers   restrictionAttributes  

<Boolean> findBestSequence

If true, optimizes the order of the stops in the route while taking into account preserveFirstStop and preserveLastStop, if they are set to true. The default is as defined in the specific routing network layer used in your RouteTask. For more information, see Finding the best stop sequence and Routing with time windows.
Known values: true | false

<Boolean> ignoreInvalidLocations

In routes where a stop is not located on a network or a stop could not be reached, the results will differ depending on the value of ignoreInvalidLocations.

  • When false, the solve operation will fail if at least one of the stops specified cannot be located or reached.
  • When true, as long as there are at least two valid stops that have been connected by a route, a valid result is returned. If multiple routes are processed in a single request, as long as least one route is built, a valid result is returned. The list of routes that cannot be solved is included in the message parameter of RouteTask.onSolveComplete.
Known values: true | false

<String> impedanceAttribute

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 array, it will default to 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.

For more information, see Understanding the network attribute.

<Number> outputGeometryPrecision

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.

<String> outputGeometryPrecisionUnits

The units of the output geometry precision. The default value is "esriUnknownUnits".

<String> outputLines

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. For possible values, see NAOutputLine.

<SpatialReference> outSpatialReference

The well-known ID of the spatial reference for the geometries returned with the analysis results. If not specified, the geometries are returned in the spatial reference of the map. See Projected Coordinate Systems and Geographic Coordinate Systems for the list of supported spatial references.

<Boolean> preserveFirstStop

If true, keeps 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.
Known values: true | false

<Boolean> preserveLastStrop

If true, keeps 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.
Known values: true | false

<String[]> restrictionAttributes

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.

<String> restrictUTurns

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" and "esriNFSBNoBacktrack". See also NAUTurn.

<Boolean> returnBarriers

If true, barriers are returned as the second parameter of RouteTask.onSolveComplete.
Known values: true | false
Default value: false

<Boolean> returnDirections

If true, directions are generated and returned in the directions property of each RouteResult. For more information, see Getting driving directions.
Known values: true | false
Default value: false

<Boolean> returnRoutes

If true, routes are generated and returned in the route property of each RouteResult.
Known values: true | false
Default value: true
See also:
RouteResult.route

<Boolean> returnStops

If true, stops are returned in the stops property of each RouteResult.
Known values: true | false
Default value: false
See also:
RouteResult.stops

<Date> startTime

The time the route begins. If not specified, the default is the time specified in the route service.

<Object> stops

The set of stops loaded as network locations during analysis. Can be either an instance of DataLayer or FeatureSet. When RouteParameters.stops takes a FeatureSet, each feature in the FeatureSet must have a defined spatial reference. If the feature contains x and y attributes, those values are used for the stop, even if the feature includes geometry. For the list of attributes that can be set on a stop, see the "Stop properties" section in Finding the best route.

<Boolean> useHierarchy

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.
Known values: true | false

<Boolean> useTimeWindows

If true, time windows should be used in the analysis. The default is as defined in the specific routing network layer used in your RouteTask.
Known values: true | false