FRAMES | NO FRAMES | Description | New in 10.1 | Parameters | Examples | Response |
URL | http://<nalayer-url>/solveServiceArea |
Parent Resource | Network Layer |
---|
Note: The Solve Service Area operation was added at 10.
The solve operation is performed on a network layer
resource of type service area (layerType is esriNAServerServiceArea
).
You can provide arguments to the solve service area operation as query parameters defined in the parameters table below.
M values:
outputLines
parameter supports a new value: esriNAOutputLineTrueShapeWithMeasure
. If specified, returned routes, compressed geometry, service area lines will contain M values on each vertex.
Z values:
Service Area solvers supports a new returnZ
parameter. If returnZ=true
and the Service Area solver is running against Z-aware network dataset, service area lines will contain Z values on each vertex. Input point and line locations can have Z values on them.
saPolylines and saPolygons in the response include properties hasZ
and/or hasM
to indicate if they contain z or m values.
An optional url
property to specify input facilities, barriers, polylinebarriers or polygonbarriers.
The url
value contains a REST Query request to a Feature, Map or a GP service returning a JSON featureset.
The advantage of using this format is that locations can be passed directly from a service endpoint as input to the NA operation, bypassing client as intermediate storage.
UseHierarchy:
Significantly improves performance of polygon generation. Cannot be used in conjunction with outputLines
.
TimeOfDay : 10.1 Service Area solver is time aware and can be used in conjunction with historic and real-time traffic information.
Parameter | Details |
---|---|
f | Description: The
response format. The default response format is html. Values: html | json |
facilities |
Description:
The set of facilities loaded as network locations during analysis.
Facilities can be specified using a simple comma / semi-colon based syntax or as a JSON structure.
If facilities are not specified, preloaded facilities from the map document are used in the analysis.
If an empty json object is passed ('{}') preloaded facilities are ignored.
Syntax and Examples: Simple syntax:You can use a simple comma / semi-colon based syntax if you need to specify only facility point geometries in the default spatial reference or WGS84. Syntax:facilities=x1,y1; x2, y2; ...; xn, yn Example: facilities=-122.406, 37.7831; -122.405, 37.7827
JSON Structures:Using JSON structures, you can specify 2 types of facilities:
FeaturesYou can specify facility geometries as well as attributes using a more comprehensive JSON structure. The JSON structure can include the following properties:
Each feature in this array represents a facility and it contains the following fields:
{ "type" : "features", "hasZ": <true|false>, "features" : [ { "geometry" : {<geometry1>}, "attributes" : {"<field1>" : <value11>, "<field2>" : <value12>} }, { "geometry" : {<geometry2>}, "attributes" : {"<field1>" : <value21>, "<field2>" : <value22>} } ], "doNotLocateOnRestrictedElements" : true | false } Example: { "features" : [ { "geometry" : {"x" : -122.406, "y" : 37.7831}, "attributes" : {"Name" : "Hospital 1", "Attr_Drivetime" : 15.0} }, { "geometry" : {"x" : -122.405, "y" : 37.7827}, "attributes" : {"Name" : "Hospital 2", "Attr_Drivetime" : 10.0} } ] } Syntax 2: using url: //This option was added at 10.1 { "type" : "features", "url" : "<url>", "doNotLocateOnRestrictedElements" : true | false } Example: { "type" : "features", "url" : "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/3/query?where=1%3D1&returnGeometry=true&outFields=*&f=json", "doNotLocateOnRestrictedElements" : true } LayerYou can specify facilities by referencing a data layer in the map service. Attribute and spatial filters can also be applied on the layer. The JSON structure can include the following properties:
{ "type" : "layer", "layerName" : "<layerName>", "where" : "<whereClause>", "geometry" : {<geometry>}, "geometryType" : "<geometryType>", "spatialRel" : "<spatialRel>" } Example: { "type" : "layer", "layerName" : "Hospitals", "where" : "BEDS > 100" } |
barriers |
Description:
The set of barriers loaded as network locations during analysis.
Barriers can be specified using a simple comma / semi-colon based syntax or as a JSON structure.
If barriers are not specified, preloaded barriers from the map document are used in the analysis.
If an empty json object is passed ('{}') preloaded barriers are ignored.
Syntax and Examples: Simple syntax:You can use a simple comma / semi-colon based syntax if you need to specify only barrier point geometries in the default spatial reference or WGS84. Syntax:barriers=x1,y1; x2, y2; ...; xn, yn Example: barriers=-122.406, 37.7831; -122.405, 37.7827
JSON Structures:Using JSON structures, you can specify 2 types of barriers:
FeaturesYou can specify barrier geometries as well as attributes using a more comprehensive JSON structure. The JSON structure can include the following properties:
Each feature in this array represents a barrier and it contains the following fields:
{ "type" : "features", "hasZ": <true|false>, "features" : [ { "geometry" : {<geometry1>}, "attributes" : {"<field1>" : <value11>, "<field2>" : <value12>} }, { "geometry" : {<geometry2>}, "attributes" : {"<field1>" : <value21>, "<field2>" : <value22>} } ] } Example: { "features" : [ { "geometry" : {"x" : -122.406, "y" : 37.7831}, "attributes" : {"Name" : "Barrier 1"} }, { "geometry" : {"x" : -122.405, "y" : 37.7827}, "attributes" : {"Name" : "Barrier 2"} } ] } Syntax 2: using url: //This option was added at 10.1 { "type" : "features", "url" : "<url>" } Example: { "type" : "features", "url" : "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/0/query?where=1%3D1&returnGeometry=true&f=json" } LayerYou can specify barriers by referencing a data layer in the map service. Attribute and spatial filters can also be applied on the layer. The JSON structure can include the following properties:
{ "type" : "layer", "layerName" : "<layerName>", "where" : "<whereClause>", "geometry" : {<geometry>}, "geometryType" : "<geometryType>", "spatialRel" : "<spatialRel>" } Example: { "type" : "layer", "layerName" : "TrafficAccidents", "where" : "SEVERITY > 0" } |
polylineBarriers |
Description: The set of polyline barriers loaded as network locations
during analysis.
If polyline barriers are not specified, preloaded polyline barriers from the map document are used in the analysis.
If an empty json object is passed ('{}') preloaded polyline barriers are ignored. Syntax and Examples: JSON Structures:Using JSON structures, you can specify 2 types of barriers:
FeaturesYou can specify polyline barrier geometries as well as attributes using a more comprehensive JSON structure. The JSON structure can include the following properties:
Each feature in this array represents a barrier and it contains the following fields:
{ "type" : "features", "hasZ": <true|false>, "features" : [ { "geometry" : {<polyline1>}, "attributes" : {"<field1>" : <value11>, "<field2>" : <value12>} }, { "geometry" : {<polyline2>}, "attributes" : {"<field1>" : <value21>, "<field2>" : <value22>} } ] } Example: { "features" : [ { "geometry" : { "paths" : [ [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832] ], [ [-97.06326,32.759], [-97.06298,32.755] ] ], "spatialReference" : {"wkid" : 4326} }, "attributes" : {"Name" : "Barrier 1"} }, { "geometry" : { "paths" : [ [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832] ], [ [-97.06326,32.759], [-97.06298,32.755] ] ], "spatialReference" : {"wkid" : 4326} }, "attributes" : {"Name" : "Barrier 2"} } ] } Syntax 2: using url: //This option was added at 10.1 { "type" : "features", "url" : "<url>" } Example: { "type" : "features", "url" : "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/6/query?where=1%3D1&returnGeometry=true&f=json" } LayerYou can specify polyline barriers by referencing a data layer in the map service. Attribute and spatial filters can also be applied on the layer. The JSON structure can include the following properties:
{ "type" : "layer", "layerName" : "<layerName>", "where" : "<whereClause>", "geometry" : {<geometry>}, "geometryType" : "<geometryType>", "spatialRel" : "<spatialRel>" } Example: { "type" : "layer", "layerName" : "PolylineBarrier" } |
polygonBarriers |
Description:
The set of polygon barriers loaded as network locations during analysis.
If polygon barriers are not specified, preloaded polygon barriers from the map document are used in the analysis.
If an empty json object is passed ('{}') preloaded polygon barriers are ignored. Syntax and Examples: JSON Structures:Using JSON structures, you can specify 2 types of barriers:
FeaturesYou can specify polygon barrier geometries as well as attributes using a more comprehensive JSON structure. The JSON structure can include the following properties:
Each feature in this array represents a barrier and it contains the following fields:
{ "type" : "features", "features" : [ { "geometry" : {<polygon1>}, "attributes" : {"<field1>" : <value11>, "<field2>" : <value12>} }, { "geometry" : {<polygon3>}, "attributes" : {"<field1>" : <value21>, "<field2>" : <value22>} } ] } Example: { "features" : [ { "geometry" : { "rings" : [ [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832], [-97.06138,32.837] ], [ [-97.06326,32.759], [-97.06298,32.755], [-97.06153,32.749], [-97.06326,32.759] ] ], "spatialReference" : {"wkid" : 4326} }, "attributes" : {"Name" : "Barrier 1"} }, { "geometry" : { "rings" : [ [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832], [-97.06138,32.837] ], [ [-97.06326,32.759], [-97.06298,32.755], [-97.06153,32.749], [-97.06326,32.759] ] ], "spatialReference" : {"wkid" : 4326} }, "attributes" : {"Name" : "Barrier 2"} } ] } Syntax 2: using url: //This option was added at 10.1 { "type" : "features", "url" : "<url>" } Example: { "type" : "features", "url" : "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/7/query?where=1%3D1&returnGeometry=true&f=json" } LayerYou can specify polygon barriers by referencing a data layer in the map service. Attribute and spatial filters can also be applied on the layer. The JSON structure can include the following properties:
{ "type" : "layer", "layerName" : "<layerName>", "where" : "<whereClause>", "geometry" : {<geometry>}, "geometryType" : "<geometryType>", "spatialRel" : "<spatialRel>" } Example: { "type" : "layer", "layerName" : "PolygonBarrier" } |
attributeParameterValues |
Description:
A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle.
Syntax: [ { "attributeName" : "<attribute1>", "parameterName" : "<parameter1>", "value" : "<value1>" }, { "attributeName" : "<attribute2>", "parameterName" : "<parameter2>", "value" : "<value2>" } ] Example: [ { "attributeName" : "Time", "parameterName" : "65 MPH", "value" : "5.0" } ] |
defaultBreaks |
Description: A comma-separated list of doubles. The default is defined in
the network analysis layer.
|
excludeSourcesFromPolygons |
Description: A comma-separated list of string names.
The default is defined in the network analysis layer.
|
mergeSimilarPolygonRanges |
Description: If
true , similar ranges will be merged in the result polygons. The
default is defined in the network analysis layer.Values: true | false
|
outputLines |
Description: The type of lines(s) generated.
The default is as defined in the network analysis layer.
If esriNAOutputLineTrueShape is specified, the useHierarchy parameter will be ignored since the hierarchy cannot be used.
Values: esriNAOutputLineNone | esriNAOutputLineTrueShape | esriNAOutputLineTrueShapeWithMeasure |
outputPolygons |
Description: The type of polygon(s) generated.
The default is as defined in the network analysis layer.
Values: esriNAOutputPolygonNone | esriNAOutputPolygonSimplified | esriNAOutputPolygonDetailed |
overlapLines |
Description: Indicates if the lines should overlap from multiple facilities. The
default is defined in the network analysis layer. Values: true | false
|
overlapPolygons |
Description: Indicates if the polygons for all facilities should overlap. The
default is defined in the network analysis layer. Values: true | false
|
splitLinesAtBreaks |
Description: If true , lines will be split at breaks. The
default is defined in the network analysis layer.Values: true | false
|
splitPolygonsAtBreaks |
Description: If true , polygons will be split at breaks. The
default is defined in the network analysis layer.Values: true | false
|
trimOuterPolygon |
Description: If true , the outermost polygon (at the maximum
break value) will be trimmed. The
default is defined in the network analysis layer.Values: true | false
|
trimPolygonDistance |
Description: If polygons are being trimmed, provides the distance to trim.
The default is defined in the network analysis layer.
|
trimPolygonDistanceUnits |
Description: If polygons are being trimmed, specifies the units of the
trimPolygonDistance.
The default is defined in the network analysis layer.
Values esriUnknownUnits | esriInches | esriPoints | esriFeet | esriYards | esriMiles | esriNauticalMiles | esriMillimeters | esriCentimeters | esriMeters | esriKilometers | esriDecimalDegrees | esriDecimeters
|
returnFacilities |
Description: If true , facilities will be returned with the analysis results.
Default is false .The facilities are available in the facilities property of the JSON response.
Values: true | false
|
returnBarriers |
Description: If true , barriers will be returned with the analysis results.
Default is false .
The barriers are available in the barriers property of the JSON response.Values: true | false
|
returnPolylineBarriers |
Description: If true , polyline barriers will be returned with the analysis results.
Default is false .
The polyline barriers are available in the polylineBarriers property of the JSON response.
Values: true | false
|
returnPolygonBarriers |
Description: If true , polygon
barriers will be returned with the analysis results.
Default is false .
The polygon barriers are available in the polygonBarriers property of the JSON response.
Values: true | false
|
outSR |
Description: 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. |
accumulateAttributeNames |
Description: The list of network attribute names to be accumulated with the analysis.
The default is as defined in the network analysis layer.
The value should be specified as a comma separated list of attribute names. You can also specify a value of none to indicate that no network attributes should be accumulated.
Example: accumulateAttributeNames=WalkingMinutes,Meters
|
impedanceAttributeName |
Description: The network attribute name to be used as the impedance attribute in analysis.
The default is as defined in the network analysis layer.
Example: impedanceAttributeName=DrivingMinutes
|
restrictionAttributeNames |
Description: The list of network attribute names to be used as restrictions with the analysis.
The default is as defined in the network analysis layer.
The value should be specified as a comma separated list of attribute names. You can also specify a value of none to indicate that no network attributes should be used as restrictions.
Example: restrictionAttributeNames=Oneway
|
restrictUTurns |
Description: Specifies how U-Turns should be restricted in the analysis.
The default is as defined in the network analysis layer.
Values: esriNFSBAllowBacktrack | esriNFSBAtDeadEndsOnly | esriNFSBNoBacktrack | esriNFSBAtDeadEndsAndIntersections
|
outputGeometryPrecision |
Description: The precision of the output geometry after generalization.
If 0, no generalization of output geometry is performed.
The default is as defined in the network service configuration.
If present and positive, it represents the MaximumAllowableOffset parameter - generalization is performed according to
IPolycurve.Generalize.
Example: outputGeometryPrecision=0.5
|
outputGeometryPrecisionUnits |
Description: The units of the output geometry precision.
The default value is esriUnknownUnits
Values: esriUnknownUnits | esriCentimeters | esriDecimalDegrees | esriDecimeters | esriFeet | esriInches | esriKilometers |
esriMeters | esriMiles | esriMillimeters | esriNauticalMiles | esriPoints | esriYards
|
useHierarchy |
Description: If true , the hierarchy attribute for the network should be used in analysis.
The default is as defined in the network layer. This cannot be used in conjunction with outputLines .
Values: true | false
|
timeOfDay |
Description: Local date and time at the facility.
if travelDirection set to esriNATravelDirectionToFacility ,
the timeOfDay value will specify arrival time to the facility.
if travelDirection set to esriNATravelDirectionFromFacility ,
the timeOfDay value will specify departure time from the facility.
Values: specified by number of milliseconds since midnight Jan 1st, 1970, UTC. |
travelDirection |
Description: Options for traveling to or from the facility. The default
is defined in the network analysis layer. Values: esriNATravelDirectionFromFacility |
esriNATravelDirectionToFacility |
returnZ |
//This option was added at 10.1 Description: If true , Z values will be included in saPolygons and saPolylines geometry if the network dataset is Z-aware.
The default is false .
|
Example 1: Solve Service Area for 1 Facility http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Service%20Area/solveServiceArea?facilities=%7B%22features%22%3A+%5B%0D%0A%0D%0A++%7B%0D%0A%22attributes%22%3A+%7B%22Name%22%3A+%22San+Francisco+Museum+of+Modern+Art%22%2C%22Breaks_Length%22+%3A+10.0%7D%2C%0D%0A++++%22geometry%22%3A+%7B%0D%0A++++++%22x%22%3A+-122.401134465%2C%0D%0A++++++%22y%22%3A+37.7857056500001%0D%0A++++%7D%0D%0A%7D%5D%7D%0D%0A&barriers=%7B%7D&polylineBarriers=%7B%7D&polygonBarriers=%7B%7D&defaultBreaks=5.0&excludeSourcesFromPolygons=&mergeSimilarPolygonRanges=false&overlapLines=false&overlapPolygons=false&splitLinesAtBreaks=false&splitPolygonsAtBreaks=false&trimOuterPolygon=false&trimPolygonDistance=100.0&trimPolygonDistanceUnits=esriMeters&outSR=26911&accumulateAttributeNames=&impedanceAttributeName=Length&restrictionAttributeNames=&attributeParameterValues=&restrictUTurns=esriNFSBAllowBacktrack&returnFacilities=true&returnBarriers=true&returnPolylineBarriers=false&returnPolygonBarriers=false&outputLines=esriNAOutputLineNone&outputPolygons=esriNAOutputPolygonSimplified&travelDirection=esriNATravelDirectionFromFacility&outputGeometryPrecision=0.01&outputGeometryPrecisionUnits=esriMeters&f=html
{ "saPolygons" : { "spatialReference" : { <spatialReference> }, "hasZ": <true|false>, "hasM": <true|false>, "features" : [ <array of <polygon> features> ] }, "saPolylines" : { "spatialReference" : { <spatialReference> }, "hasZ": <true|false>, "hasM": <true|false>, "features" : [ <array of <polyline> features> ] }, "facilities" : { "spatialReference" : { <spatialReference> }, "hasZ": <true|false>, "features" : [ <array of <point> features> ] }, "barriers" : { "spatialReference" : { <spatialReference> }, "hasZ": <true|false>, "features" : [ <array of <point> features> ] }, "polylineBarriers" : { "spatialReference" : { <spatialReference> }, "hasZ": <true|false>, "features" : [ <array of <polyline> features> ] }, "polygonBarriers" : { "spatialReference" : { <spatialReference> }, "features" : [ <array of <polygon> features> ] }, "messages" : [ {<message1>}, {<message2>},... ] } where each features object is defined as: "features": [ { "attributes": { "<field1>": <value11>, "<field2>": <value12> }, "geometry": {<geometry1>} }, { "attributes": { "<field1>": <value21>, "<field2>": <value22> }, "geometry": {<geometry2>} } ] and each message is defined as: { "type" : <type1>, "description" : <description1> }
{ "saPolygons": { "features": [ { "attributes": { "ObjectID": 1, "FacilityID: 3, "Name": "Some name", "FromBreak": 0.0, "ToBreak": 10.0, "Shape_Length": 0.171641389705288 }, "geometry" : { "rings" : [ [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832], [-97.06138,32.837] ], [ [-97.06326,32.759], [-97.06298,32.755], [-97.06153,32.749], [-97.06326,32.759] ] ], "spatialReference" : {"wkid" : 4326} } } ] }, "facilities" : { "features": [ { "attributes": { "ObjectID": 1, "Name": "Location 1", "Sequence": 1, "TimeWindowStart": null, "TimeWindowEnd": null, "ArriveCurbApproach": 1, "DepartCurbApproach": 2 }, "geometry": { "x": -122.4079, "y": 37.7835 } }, { "attributes": { "ObjectID": 2, "Name": "Location 2", "Sequence": 2, "TimeWindowStart": null, "TimeWindowEnd": null, "ArriveCurbApproach": 1, "DepartCurbApproach": 2 }, "geometry": { "x": -122.3931, "y": 37.79496 } } ] }, "barriers": { "features": [ { "attributes": { "ObjectID": 1, "Name": "Barrier 1", "SourceID": 1, "SourceOID": 9619, "PosAlong": 0.841037735851507, "SideOfEdge": 2, "CurbApproach": null, "Status": 0 }, "geometry": { "x": -122.41, "y": 37.7889 } } ] }, messages": [ { "type": 50, "description": "Some message 1." }, { "type": 50, "description": "Some message 2." } ] }