Class: ClosestFacilityParameters

Description

Class added v2.0.

Input parameters for the ClosestFacilityTask.

Note: ClosestFacilityParameters and other closest facility related classes require ArcGIS Server 10.0 or greater and a closest facility layer. A closest facility layer is a layer of type esriNAServerClosestFacilityLayer.

Samples

Search for samples that use this class.  

Class hierarchy

esri.esri.tasks.ClosestFacilityParameters

Constructor

Constructor Description
esri.esri.tasks.ClosestFacilityParameters() Creates a new ClosestFacilityParameters 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.
attributeParameterValues Object[] An array of attribute parameter values that determine which network elements can be used by a vehicle.
defaultCutoff Number The cutoff value used to determine when to stop traversing.
defaultTargetFacilityCount int The number of facilities to find.
directionsLanguage String The language used when computing directions. By default the task will use the language defined in the network layer used by the RouteTask.
directionsLengthUnits String The length units used when computing directions. By default the value defined by the routing network layer is used.
directionsTimeAttribute String The name of the attribute field that contains the drive time values. If not specified the task will use the attribute field defined by the routing network layer.
facilities Object The set of facilities loaded as network locations during analysis.
impedenceAttribute String The network attribute field name used as the impedence attribute during analysis.
incidents Object The set of incidents loaded as network locations during analysis.
outputGeometryPrecision Number The output geometry precision.
outputGeometryPrecisionUnits String The units of the output geometry precision. The default value is esriUnknownUnits
outputLines String The type of output lines generated in the result.
outSpatialReference SpatialReference The well-known id of the spatial reference for the geometries returned with the analysis results. If the outSpatialReference is not specified, the geometries are returned in the spatial reference of the map.
pointBarriers Object The set of point barriers loaded as network locations during analysis. Can be an instance of esri.tasks.DataLayer or esri.tasks.FeatureSet.
polygonBarriers Object The set of polygon barriers loaded as network locations during analysis. Can be an instance of esri.tasks.DataLayer or esri.tasks.FeatureSet.
polylineBarriers Object The set of polyline barriers loaded as network locations during analysis. Can be an instance of esri.tasks.DataLayer or esri.tasks.FeatureSet.
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. The default is as defined in the specific routing network layer used in your RouteTask.
returnDirections Boolean If true, directions will be generated and returned in the directions property of each RouteResult and RouteSolveResult. Default value is false.
returnFacilities Boolean If true, facilities will be returned with the analysis results. Default values is false.
returnIncidents Boolean If true, incidents will be returned with the analysis results. Default value is false.
returnPointBarriers Boolean If true, barriers will be returned in the barriers property of the ClosestFacilitySolveResult. Default value is false.
returnPolygonBarriers Boolean If true, polygon barriers will be returned in the barriers property of the ClosestFacilitySolveResult. Default value is false.
returnPolylineBarriers Boolean If true, polyline barriers will be returned in the barriers property of the ClosestFacilitySolveResult. Default value is false.
returnRoutes Boolean When true, closest facility routes will be generated and returned in the route property of each ClosestFacilityResult and ClosestFacilitySolveResult. Default value is true.
travelDirection String Options for traveling to or from the facility. Default values are defined by the newtork layer. See NATravelDirection for a list of valid values.
useHierarchy Boolean If true, the hierarchy attribute for the network will be used in analysis. The default is defined in the routing network layer used by the ClosestFacilityTask.
Constructor Detail

esri.esri.tasks.ClosestFacilityParameters()

Creates a new ClosestFacilityParameters object
Code snippets:
 
params = new esri.tasks.ClosestFacilityParameters();
params.defaultCutoff= 3.0;
params.returnIncidents=false;
params.returnRoutes=true;
params.returnDirections=true;
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.

<Object[]> attributeParameterValues

An array of attribute parameter values that determine which network elements can be used by a vehicle. Each object has the following properties:
<String>attributeName The name of the attribute.
<String>parameterName The parameter name.
<String>parameterValue The parameter value.

<Number> defaultCutoff

The cutoff value used to determine when to stop traversing.

<int> defaultTargetFacilityCount

The number of facilities to find.

<String> directionsLanguage

The language used when computing directions. If not specified the task will use the language defined in the network layer used by the RouteTask. The default language defined by the NAServer is en_US, the server administrator is responsible for adding additional languages.

<String> directionsLengthUnits

The length units used when computing directions. If not specified the task will use the value defined by the routing network layer is used. Possible values are "esriFeet", "esriKilometers","esriMeters", "esriMiles","esriNauticalMiles" and "esriYards".

<String> directionsTimeAttribute

The name of the attribute field that contains the drive time values. If not specified the task will use the attribute field defined by the routing network layer.

<Object> facilities

The set of facilities loaded as network locations during analysis. These can be specified as either esri.tasks.DataLayer or esri.tasks.FeatureSet
Code snippets:
 
var facilities = new esri.tasks.FeatureSet();
facilities.features = facilitiesGraphicsLayer.graphics;

<String> impedenceAttribute

The network attribute field name used as the impedence attribute during analysis. If not specified the default value defined by the routing network layer.

Valid values include any attribute name listed in the Service Directory under Network Dataset > Network Attributes with a Usage Type of esriNauTCost. Specify none to indicate that no network attributes should be used for impedence. If you specify an empty string the default value defined by the service will be used. See the Understanding the network attribute help topic for more details.

<Object> incidents

The set of incidents loaded as network locations during analysis. Can be an instance of esri.tasks.DataLayer or esri.tasks.FeatureSet.
Code snippets:
 
var location = new esri.Graphic(inPoint);
incidentsGraphicsLayer.add(location);

var features = [];
features.push(location);
var incidents = new esri.tasks.FeatureSet();
incidents.features = features;
params.incidents = incidents;

<Number> outputGeometryPrecision

The output geometry precision. When 0, no generalization of the output geometry is performed. Positive values represent the MaximumAllowableOffset parameter used by 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. See NAOutputLine for a list of valid values.

<SpatialReference> outSpatialReference

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

<Object> pointBarriers

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

<Object> polygonBarriers

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

<Object> polylineBarriers

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

<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.
Code snippets:

Specify restriction attributes
routeParams.restrictionAttributes = ["OneWay"];
Override the service defaults and specify that no restrictions should be used.
routeParams.restrictionAttributes = ["none"];

<String> restrictUTurns

Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your RouteTask. See NAUTurn for a list of valid values.

<Boolean> returnDirections

If true, directions will be generated and returned in the directions property of each RouteResult and RouteSolveResult. Default value is false.
Code snippets:
  params = new esri.tasks.ClosestFacilityParameters();
  params.returnDirections=true;

<Boolean> returnFacilities

If true, facilities will be returned with the analysis results. Default values is false.

<Boolean> returnIncidents

If true, incidents will be returned with the analysis results. Default value is false.

<Boolean> returnPointBarriers

If true, barriers will be returned in the barriers property of the ClosestFacilitySolveResult. Default value is false.

<Boolean> returnPolygonBarriers

If true, polygon barriers will be returned in the barriers property of the ClosestFacilitySolveResult. Default value is false.

<Boolean> returnPolylineBarriers

If true, polyline barriers will be returned in the barriers property of the ClosestFacilitySolveResult. Default value is false.

<Boolean> returnRoutes

When true, closest facility routes will be generated and returned in the route property of each ClosestFacilityResult and ClosestFacilitySolveResult. Default value is true.

<String> travelDirection

Options for traveling to or from the facility. Default values are defined by the newtork layer. See NATravelDirection for a list of valid values.

<Boolean> useHierarchy

If true, the hierarchy attribute for the network will be used in analysis. The default is defined in the routing network layer used by the ClosestFacilityTask.