Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: ServiceAreaParameters

require(["esri/tasks/ServiceAreaParameters"], function(ServiceAreaParameters) { /* code goes here */ });

Description

(Added at v2.0)
Input parameters for a ServiceAreaTask.

Note: ServiceAreaParameters, and other service area related classes, requires ArcGIS Server 10.0 or above and a service area layer. A service area layer is a layer of type esriNAServerServiceAreaLayer.

Samples

Search for samples that use this class.

Constructors

NameSummary
new ServiceAreaParameters()Creates a new ServiceAreaParameters object.

Properties

NameTypeSummary
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[]A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle.
defaultBreaksNumber[]An array of numbers defining the breaks.
doNotLocateOnRestrictedElementsBooleanWhen true, restricted network elements should be considered when finding network locations.
excludeSourcesFromPolygonsString[]An array of network source names to NOT use when generating polygons.
facilitiesObjectThe set of facilities loaded as network locations during analysis.
impedanceAttributeStringThe network attribute name used as the impedance attribute in analysis.
mergeSimilarPolygonRangesBooleanIf true, similar ranges will be merged in the result polygons.
outSpatialReferenceSpatialReferenceThe well-known ID of the spatial reference for the geometries returned with the analysis results.
outputGeometryPrecisionNumberThe precision of the output geometry after generalization.
outputGeometryPrecisionUnitsStringThe units of the output geometry precision.
outputLinesStringThe type of output lines to be generated in the result.
outputPolygonsStringThe type of output polygons to be generated in the result.
overlapLinesBooleanIndicates if the lines should overlap from multiple facilities.
overlapPolygonsBooleanIndicates if the polygons should overlap from multiple facilities.
pointBarriersObjectThe set of point barriers loaded as network locations during analysis.
polygonBarriersObjectThe set of polygons barriers loaded as network locations during analysis.
polylineBarriersObjectThe set of polyline barriers loaded as network locations during analysis.
restrictUTurnsStringSpecifies how U-Turns should be handled.
restrictionAttributesString[]The list of network attribute names to be used as restrictions with the analysis.
returnFacilitiesBooleanIf true, facilities will be returned with the analysis results.
returnPointBarriersBooleanIf true, barriers will be returned in the barriers property of ClosestFacilitySolveResult.
returnPolygonBarriersBooleanIf true, polygon barriers will be returned in the polygonBarriers property of ClosestFacilitySolveResult.
returnPolylineBarriersBooleanIf true, polyline barriers will be returned in the polylineBarriers property of ClosestFacilitySolveResult.
splitLinesAtBreaksBooleanIf true, lines will be split at breaks.
splitPolygonsAtBreaksBooleanIf true, polygons will be split at breaks.
timeOfDayDateLocal date and time at the facility.
travelDirectionStringOptions for traveling to or from the facility.
travelModeObjectTravel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network.
trimOuterPolygonBooleanIf true, the outermost polygon (at the maximum break value) will be trimmed.
trimPolygonDistanceNumberIf polygons are being trimmed, provides the distance to trim.
trimPolygonDistanceUnitsStringIf polygons are being trimmed, specifies the units of the trimPolygonDistance.
useHierarchyBooleanWhen true, the hierarchy attributes for the network will be used in analysis.
Constructor Details

new ServiceAreaParameters()

Creates a new ServiceAreaParameters object.
Sample:
require([
  "esri/map", "esri/tasks/ServiceAreaParameters", ... 
], function(Map, ServiceAreaParameters, ... ) {
  var map = new Map( ... );
  var params = new ServiceAreaParameters();
  params.defaultBreaks = [2];
  params.outSpatialReference = map.spatialReference;
  params.returnFacilities = false;
  ...
});
Property Details

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

<Object[]> attributeParameterValues

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.

<Number[]> defaultBreaks

An array of numbers defining the breaks. The default value is defined in the network analysis layer .
Sample:

params.defaultBreaks= [1,2];

<Boolean> doNotLocateOnRestrictedElements

When true, restricted network elements should be considered when finding network locations. (Added at v3.0)
Known values: true | false
Default value: false

<String[]> excludeSourcesFromPolygons

An array of network source names to NOT use when generating polygons. ExcludeSourcesFromPolygons specifies if certain network sources should be excluded from the service area polygon generation. A service area on a multi-modal network where only one mode is being used to compute the service area would get a more appropriate shape if other modes are excluded from the polygons.

<Object> facilities

The set of facilities loaded as network locations during analysis. Can be either an instance of esri.tasks.DataLayer or esri.tasks.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 Note that either the features or url property should be specified.

Sample:
require([
  "esri/graphic", "esri/tasks/FeatureSet", ... 
], function(Graphic, FeatureSet, ... ) {
  var features = [];
  features.push(new Graphic(inPoint, pointSymbol));
  var facilities = new FeatureSet();
  facilities.features = features;
  paramsfacilities = facilities;
  ... 
});

<String> impedanceAttribute

The network attribute name 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.

View the Understanding the network attribute ArcGIS desktop help topic for more details.

<Boolean> mergeSimilarPolygonRanges

If true, similar ranges will be merged in the result polygons.
Known values: true | false

<SpatialReference> outSpatialReference

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

<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.
Known values: esriUnknownUnits | esriCentimeters | esriDecimalDegrees | esriDecimeters | esriFeet | esriInches | esriKilometers | esriMeters | esriMiles | esriMillimeters | esriNauticalMiles | esriPoints | esriYards
Default value: 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.

<String> outputPolygons

The type of output polygons to be generated in the result. The default is as defined in the specific routing network layer used in your ServiceAreaTask. See NAOutputPolygon for a list of valid values.

<Boolean> overlapLines

Indicates if the lines should overlap from multiple facilities. The default is defined by the network analysis layer in your ServiceAreaTask.
Known values: true | false

<Boolean> overlapPolygons

Indicates if the polygons should overlap from multiple facilities. The default is defined by the network analysis layer in your ServiceAreaTask.
Known values: true | false

<Object> pointBarriers

The set of point barriers loaded as network locations during analysis. Can be either an instance of esri.tasks.DataLayer or esri.tasks.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 Note that either the features or url property should be specified.

<Object> polygonBarriers

The set of polygons barriers loaded as network locations during analysis. Can be either an instance of esri.tasks.DataLayer or esri.tasks.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 Note that either the features or url property should be specified.

<Object> polylineBarriers

The set of polyline barriers loaded as network locations during analysis. Can be either an instance of esri.tasks.DataLayer or esri.tasks.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 Note that either the features or url property should be specified.

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

<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.
Sample: Use restriction attributes

myRouteParams.restrictionAttributes = ["OneWay"];

Do not use the service defaults for restrictions:

myRouteParams.restrictionAttributes = ["none"];

<Boolean> returnFacilities

If true, facilities will be returned with the analysis results.
Known values: true | false
Default value: false

<Boolean> returnPointBarriers

If true, barriers will be returned in the barriers property of ClosestFacilitySolveResult.
Known values: true | false
Default value: false

<Boolean> returnPolygonBarriers

If true, polygon barriers will be returned in the polygonBarriers property of ClosestFacilitySolveResult. The default value is false.
Known values: true | false

<Boolean> returnPolylineBarriers

If true, polyline barriers will be returned in the polylineBarriers property of ClosestFacilitySolveResult. The default value is false.
Known values: true | false
Default value: false

<Boolean> splitLinesAtBreaks

If true, lines will be split at breaks.
Known values: true | false

<Boolean> splitPolygonsAtBreaks

If true, polygons will be split at breaks.
Known values: true | false

<Date> timeOfDay

Local date and time at the facility. if travelDirection set to TO_FACILITY, timeOfDay value specifies arrival time at the facility. if travelDirection set to FROM_FACILITY, timeOfDay specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. (Added at v2.6)

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

<Object> travelMode

Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. This can take values from the supportedTravelModes array returned by the ServiceAreaTask's getServiceDescription() method. Each Travel Mode is preset in the Network Analysis settings configured inside the network dataset, in a ArcGIS Online Organization, or inside a Portal for ArcGIS. (Added at v3.14)
Default value: Null
Object Specifications:
<travelMode>
<Object[]> attributeParameterValues Required An array of objects used to identify specific vehicle characteristics or how soft to make each restriction. Each object will have the following properties: attributeName, parameterName, and value. For additional information regarding attribute parameters, see the ArcGIS Online help topic.
<String> description Required A description of the travel mode used.
<String> distanceAttributeName Required The restriction attributes to respect during analysis. A list of possible restrictions of the ArcGIS Online services is listed here.

NOTE: Attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online.
<String> id Required Unique identifier for the travel mode.
<String> impedanceAttributeName Required The cost attribute on which to optimize the analysis, e.g. "Miles", "Minutes", "Travel Time", "Kilometers", "TimeAt1KPH", "WalkTime", and "TruckTravelTime".

NOTE: Attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online.

NOTE: Attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online.
<String> name Required Name of the travel mode. Users of ArcGIS Online or Portal for ArcGIS can define custom Travel Modes inside their Organization settings. Authors of stand alone Network Analysis Services can define their own Travel Modes inside a network dataset.

Default ArcGIS Online Travel Modes are: "Driving Distance", "Rural Driving Distance", "Driving Time", "Rural Driving Time", "Trucking Distance", "Trucking Time", "Walking Distance", and "Walking Time".
<String[]> restrictionAttributeNames Required The restriction attributes to respect during analysis. A list of possible restrictions of the ArcGIS Online services is listed here.

NOTE: Attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online.
<String> simplicationToleranceUnits Required Possible values are: "esriFeet", "esriKilometers", "esriMeters", "esriMiles", "esriNauticalMiles", and "esriYards".
<Number> simplificationTolerance Required How much to generalize the output geometry.
<String> timeAttributeName Required The time-based cost attribute for reporting directions, e.g. "Minutes", "Travel Time", "TimeAt1KPH", "WalkTime", and "TruckTravelTime".

NOTE: Attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online.
<String> type Required The travel mode type. Possible values are: "AUTOMOBILE", "TRUCK", "WALK", or "OTHER".
<Boolean> useHierarchy Required Indicates whether or not to use a hierarchical road classification for faster analysis.
<String> uturnAtJunctions Required Specify where u-turns are allowed. Possible values are: "esriNFSBAllowBacktrack", "esriNFSBAtDeadEndsOnly", "esriNFSBNoBacktrack", and "esriNFSBAtDeadEndsAndIntersections".

<Boolean> trimOuterPolygon

If true, the outermost polygon (at the maximum break value) will be trimmed. The default is defined in the network analysis layer in your ServiceAreaTask.
Known values: true | false

<Number> trimPolygonDistance

If polygons are being trimmed, provides the distance to trim. The default is defined in the network analysis layer.

<String> trimPolygonDistanceUnits

If polygons are being trimmed, specifies the units of the trimPolygonDistance. The default is defined in the network analysis layer. See the ESRI Unit constants table for a list of valid values.

<Boolean> useHierarchy

When true, the hierarchy attributes for the network will be used in analysis. The default value is defined in the network layer. useHierarchy cannot be used in conjunction with outputLines. Requires ArcGIS Server service version 10.1 or greater. (Added at v2.6)
Known values: true | false