Input parameters for ClosestFacilityTask.
ClosestFacilityParameters, and other closest facility related classes require a "closest facility" layer. A closest facility layer is a layer of type esriNAServerClosestFacilityLayer
.
Constructors
new ClosestFacilityParameters(properties)
properties Object See the properties for a list of all the properties that may be passed into the constructor. |
require([
"esri/tasks/support/ClosestFacilityParameters", "esri/tasks/ClosestFacilityTask", ...
], function(ClosestFacilityParameters, ClosestFacilityTask, ... ) {
var closestFacilityTask = new ClosestFacilityTask( ... ); // Add task url here
var params = new ClosestFacilityParameters({
defaultCutoff: 3.0,
returnIncidents: false,
returnRoutes: true,
returnDirections: true
});
closestFacilityTask.solve(params).then(function(solveResult){
// solveResult contains the result of the task
});
});
Property Overview
Name | Type | Summary | |
---|---|---|---|
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. more details | more details | |
Object[] | An array of attribute parameter values that determine which network elements can be used by a vehicle. more details | more details | |
String | The name of the class. more details | more details | |
Number | The cutoff value used to determine when to stop traversing. more details | more details | |
Number | The number of facilities to find. more details | more details | |
String | The language used when generating driving directions. more details | more details | |
String | The length units used when computing driving directions. more details | more details | |
String | Defines the amount of direction information returned. more details | more details | |
String | The style to be used when returning directions. more details | more details | |
String | The name of the attribute field that contains the drive time values. more details | more details | |
Boolean | When | more details | |
DataLayer | FeatureSet | The set of facilities loaded as network locations during analysis. more details | more details | |
String | The network attribute field name used as the impedance attribute during analysis. more details | more details | |
DataLayer | FeatureSet | The set of incidents loaded as network locations during analysis. more details | more details | |
Number | The output geometry precision. more details | more details | |
String | The units of the output geometry precision. more details | more details | |
String | The type of output lines to be generated in the result. more details | more details | |
SpatialReference | String | The well-known id of the spatial reference or the spatial reference object for the geometries returned with the analysis results. more details | more details | |
DataLayer | FeatureSet | The set of point barriers loaded as network locations during analysis. more details | more details | |
DataLayer | FeatureSet | The set of polygon barriers loaded as network locations during analysis. more details | more details | |
DataLayer | FeatureSet | The set of polyline barriers loaded as network locations during analysis. more details | more details | |
String[] | The list of network attribute names to be used as restrictions with the analysis. more details | more details | |
String | Specifies how U-Turns should be handled. more details | more details | |
Boolean | Indicates whether the service should generate driving directions for each route. more details | more details | |
Boolean | If | more details | |
Boolean | If | more details | |
Boolean | If | more details | |
Boolean | If | more details | |
Boolean | If | more details | |
Boolean | When | more details | |
Date | The arrival or departure date and time. more details | more details | |
String | Defines the way the | more details | |
String | Options for traveling to or from the facility. more details | more details | |
Boolean | If | more details |
Property Details
accumulateAttributesString[]
The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response.
attributeParameterValuesObject[]
An array of attribute parameter values that determine which network elements can be used by a vehicle. View the object specifications below for properties of the individual objects in this array.
declaredClassStringreadonly
The name of the class. The declared class name is formatted as
esri.folder.className
.defaultCutoffNumber
The cutoff value used to determine when to stop traversing.
defaultTargetFacilityCountNumber
The number of facilities to find.
directionsLanguageString
The language used when generating driving directions. This parameter applies only when returnDirections parameter is set to
true
. If an unsupported language code is specified, the service returns the directions using the default language, English.directionsLengthUnitsString
The length units used when computing driving directions. This parameter applies only when returnDirections parameter is set to
true
. If not specified the task will use the value defined by the routing network layer is used.Known Values: centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards
directionsOutputTypeString
Defines the amount of direction information returned. The default value is standard.
Known Values: complete | complete-no-events | instructions-only | standard | summary-only
directionsStyleNameString
The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles.
directionsTimeAttributeString
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.
doNotLocateOnRestrictedElementsBoolean
When
true
, restricted network elements should be considered when finding network locations.Default Value: truefacilitiesDataLayer|FeatureSet
The set of facilities loaded as network locations during analysis. These can be specified as either a DataLayer or a FeatureSet.
At ArcGIS Server 10.1 an optional
url
property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using DataFile. Either the features or url property should be specified.Example:require([ "esri/layers/GraphicsLayer", "esri/tasks/support/FeatureSet", "esri/tasks/support/DataFile", ... ], function(GraphicsLayer, FeatureSet, DataFile, ... ) { var facilitiesGraphicsLayer = new GraphicsLayer(); // Specify facilities using a FeatureSet var facilities = new FeatureSet(); facilities.features = facilitiesGraphicsLayer.graphics.toArray(); // Requires ArcGIS Server 10.1 or greater var networkServiceUrl = 'https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/'; params.facilities = new DataFile({ url: networkServiceUrl + "3/query?where=1%3D1&returnGeometry=true&outFields=*&f=json" }); ... });
impedanceAttributeString
The network attribute field name used as the impedance 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 impedance. 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.incidentsDataLayer|FeatureSet
The set of incidents loaded as network locations during analysis. Can be an instance of DataLayer or FeatureSet. At ArcGIS Server 10.1 an optional
url
property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using DataFile. Either the features or url property should be specified.outputGeometryPrecisionNumber
The output geometry precision. When
0
, no generalization of the output geometry is performed. Positive values represent theMaximumAllowableOffset
parameter used by generalize.outputGeometryPrecisionUnitsString
The units of the output geometry precision.
Known Values: centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards
outputLinesString
The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. See NAOutputLine for a list of valid values.
outSpatialReferenceSpatialReference|String
The well-known id of the spatial reference or the spatial reference object for the geometries returned with the analysis results. If
outSpatialReference
is not specified, the geometries are returned in the spatial reference of the map.pointBarriersDataLayer|FeatureSet
The set of point barriers loaded as network locations during analysis. Can be an instance of DataLayer or FeatureSet. At ArcGIS Server 10.1 an optional
url
property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using DataFile. Either the features or url property should be specified.polygonBarriersDataLayer|FeatureSet
The set of polygon barriers loaded as network locations during analysis. Can be an instance of DataLayer or FeatureSet. At ArcGIS Server 10.1 an optional
url
property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using DataFile. Either the features or url property should be specified.polylineBarriersDataLayer|FeatureSet
The set of polyline barriers loaded as network locations during analysis. Can be an instance of DataLayer or FeatureSet. At ArcGIS Server 10.1 an optional
url
property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using DataFile. Either the features or url property should be specified.restrictionAttributesString[]
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. Use
["none"]
to override the service defaults and specify that no restrictions should be used.restrictUTurnsString
Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask".
Known Values: allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections
returnDirectionsBoolean
Indicates whether the service should generate driving directions for each route.
Default Value: falsereturnFacilitiesBoolean
If
true
, facilities will be returned with the analysis results.Default Value: falsereturnIncidentsBoolean
If
true
, incidents will be returned with the analysis results.Default Value: falsereturnPointBarriersBoolean
If
true
, point barriers will be returned in the barriers property of the ClosestFacilitySolveResult.Default Value: falsereturnPolygonBarriersBoolean
If
true
, polygon barriers will be returned in the barriers property of the ClosestFacilitySolveResult.Default Value: falsereturnPolylineBarriersBoolean
If
true
, polyline barriers will be returned in the barriers property of the ClosestFacilitySolveResult.Default Value: falsereturnRoutesBoolean
When
true
, closest facility routes will be generated and returned in the route property of each ClosestFacilitySolveResult.Default Value: truetimeOfDayDate
The arrival or departure date and time. For example, if the travelDirection is set to
TO_FACILITY
andtimeOfDayUsage
is set to "end" andtimeOfDay
is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. Requires ArcGIS Server service version 10.1 or greater.timeOfDayUsageString
Defines the way the
timeOfDay
value is used. The default value is defined in the network layer. Requires ArcGIS Server service version 10.1 or greater.Known Values: start | end
travelDirectionString
Options for traveling to or from the facility. Default values are defined by the newtork layer. See NATravelDirection for a list of valid values.
useHierarchyBoolean
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.Default Value: false
Method Overview
Name | Return Type | Summary | |
---|---|---|---|
Object | Converts an instance of this class to its ArcGIS Portal JSON representation. more details | more details |
Method Details
toJSON(){Object}
Converts an instance of this class to its ArcGIS Portal JSON representation. See the Using fromJSON() topic in the Guide for more information.
Returns:Type Description Object The ArcGIS Portal JSON representation of an instance of this class.