Service Area service with asynchronous execution

With the service area service, you can find the area that can be reached from the input location within a given travel time or travel distance. A service area is the area that encompasses all streets that can be accessed within a given distance or travel time from one or more locations, referred to as facilities. Service areas are generally used to visualize and measure the accessibility of facilities. For example, a three-minute drive-time polygon around a grocery store can determine which residents are able to reach the store within three minutes and are thus more likely to shop there. The service can also create multiple concentric service areas around one or more facilities that can show how accessibility changes with an increase in travel time or travel distance. It can be used, for example, to determine how many hospitals are within 5, 10, and 15 minute drive times of schools. When creating service areas based on travel times, the service can make use of traffic data, which can influence the area that can be reached during different times of the day.

Request URL

The service area service supports synchronous and asynchronous execution modes. Asynchronous and synchronous modes define how the application interacts with the service and gets the result. When using the synchronous execution mode, the application must wait for the request to finish and get the results. This execution mode is well-suited for requests that complete quickly (under 10 seconds). When using the asynchronous execution mode, the client must periodically check if the service has finished execution and once completed get the result. While the service is executing, the application is free to do other things. This execution mode is well-suited for requests that take a long time to complete.

While the service supports same functionality with both execution modes, the choice of the execution mode depends on the type of request your application has to make as well the size of problem you need to solve using the service. In synchronous mode, the service supports a maximum of 100 facilites in a single request. In asynchronous mode, the service supports a maximum of 1,000 facilites in a single request. So, for example, if you are generating service areas for less than 100 facilities, you can choose the synchronous execution mode. However, if your application needs to support more than 100 facilities, you need to use asynchronous execution mode.

The request URL and the parameter names supported by the service when using synchronous execution are different and described in the Service Area Service with Synchronous Execution page.

CautionCaution:

The maximum time an application can use the service area service when using the asynchronous execution mode is 1 hour (3,600 seconds). If your request does not complete within that time limit, it will time out and return a failure.

When using the asynchronous execution mode, the request is of the following form

http://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas/submitJob?parameters

Dive-inDive-in:

The service works in all of the supported countries as listed in the data coverage page. One or more countries are grouped together to form a region. When you pass in your inputs, the service determines the region containing all of the inputs based on the location of the first facility in the facilities parameter. The service does not support requests that span more than one region. Consequently, service areas will be found only for those facilities that are in the same region as the first facility.

Request parameters

The service area request takes the following parameters. The only required parameters are facilities, token and f. The optional parameters have default values which will be used if the parameter is not specified in the request.

Required parameters

facilities

Use this parameter to specify one or more locations, around which service areas are generated. These locations are called facilities.

CautionCaution:

The service imposes a maximum limit of 1,000 facilities. If the number of points passed as facilities exceeds this value, the response returns an error message.

The facilities parameter can be specified using a JSON structure that represents a set of features. The JSON structure can include the following properties:

  • url: Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set. This property is optional. However, either features or url must be specified.
  • spatialReference: Specifies the spatial reference for the facility geometries. This property is not required if the coordinate values are in the default spatial reference, WGS84. If the coordinate values are in a different spatial reference, you need to specify the well-known ID (WKID) for the spatial reference. You can find the WKID for your spatial reference depending on whether the coordinates are represented in a geographic coordinate system or a projected coordinate system.
  • fields: Lists the fields that are part of the input features representing facilities. This property is optional if you are using the default field, Name, by itself. However, it is required if your facilities include custom fields.
  • features: Specify an array of features. This property is optional. However, either the features or url property must be specified.

Each feature in the features array represents a facility and contains the following properties:

  • geometry: Specifies the facility geometry as a point containing x and y properties.
  • attributes: Specify each attribute as a key-value pair where the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for facilities

When specifying the facilities, you can specify additional properties for facilities, such as their names or custom attributes you deem valuable to include in the output service areas. The facilities parameter can be specified with the following attributes:

  • Name: The name of the facility.
  • Any custom attributes, or fields, you add to the input facilities are included in the resultant service areas, except when polygons_for_multiple_facilities is set to Merge by Break Value.
Syntax for specifying facilities using JSON structure for features
{
    "spatialReference": {
        "wkid": <wkid>,
        "latestWkid": <wkid>, 
    },
    "features": [
        {
            "geometry": {
                "x": <x1>,
                "y": <y1>,
            },
            "attributes": {
                "<field1>": <value1_1>,
                "<field2>": <value1_2>
            }
        },
        {
            "geometry": {
                "x": <x2>,
                "y": <y2>,
            },
            "attributes": {
                "<field1>": <value2_1>,
                "<field2>": <value2_2>
            }
        }
    ], 
}
Syntax for specifying facilities with custom attributes using JSON structure for features
{
    "spatialReference": {
        "wkid": <wkid>,
        "latestWkid": <wkid>, 
    },
    "fields": [
        {
            "name": <name1>,
            "type": <esriFieldType>,
            "alias": <alias1>,
            "length": <length>
        },
        {
            "name": <name2>,
            "type": <esriFieldType>,
            "alias": <alias2>,
            "length": <length>
        }
    ],
    "features": [
        {
            "geometry": {
                "x": <x1>,
                "y": <y1>,
            },
            "attributes": {
                "<name1>": <value1_1>,
                "<name2>": <value1_2>
            }
        },
        {
            "geometry": {
                "x": <x2>,
                "y": <y2>,
            },
            "attributes": {
                "<name1>": <value2_1>,
                "<name2>": <value2_2>
            }
        }
    ], 
}
Syntax for specifying facilities using URL returning a JSON response
{
    "url": "<url>"
}
Example 1: Specifying facilities in the default spatial reference WGS84 using JSON structure.

The facility geometries are in the default spatial reference WGS84. Hence, the spatialReference property is not specified. The example also shows how to specify names for the facilities using the Name attribute.

{
    "features": [
        {
            "geometry": {
                "x": -0.1891,  
                "y": 51.5254
            },
            "attributes": {
                "Name": "Fire Station 35"                             
            }
        },
        {
            "geometry": {
                "x": -0.1744,
                "y": 51.5353
            },
            "attributes": {
                "Name": "Fire Station 29"
            }
        }
    ]
}
Example 2: Specifying facilities in the Web Mercator spatial reference using JSON structure.

The facility geometries are in the Web Mercator spatial reference and not in the default WGS84 spatial reference. Hence the spatialReference property is required.

{
    "spatialReference": {
        "wkid": 102100
    },
    "features": [
        {
            "geometry": {                
                "x": 2698533.989,
                "y": 5192521.476
            },
            "attributes": {
                "Name": "123 Main Street" 
            }
        },
        {
            "geometry": {
                "x": 2697821.094, 
                "y": 5191915.261
                
            },
            "attributes": {
                "Name": "845 Cypress Ave"
            }
        }
    ]
}
Example 3: Specifying facilities with custom fields using JSON structure.

In this example, the facilities include a custom field, SquareFootage; therefore, the field schema must be defined in the fields attribute. The schema of default fields must also be defined whenever a custom field is present, so the schema of the Name field is also defined. The values for the fields are specified in the features attribute. The output service areas will include copies of these input fields as long as polygons_for_multiple_facilities isn't set to Merge by Break Value. The facility geometries are in WGS84, the default spatial reference, so the spatialReference attribute isn't required.

{
    "fields": [
        {
            "name": "Name",
            "type": "esriFieldTypeString",
            "alias": "Square Footage",
            "length": 128
        },
        {
            "name": "SquareFootage",
            "type": "esriFieldTypeInteger",
            "alias": "Square Footage",
            "length": 10
        }
    ],
    "features": [
        {
            "geometry": {
                "x": -122.253,
                "y": 37.757
            },
            "attributes": {
                "Name": "SF Store",
                "SquareFootage": 1800
            }
        },
        {
            "geometry": {
                "x": -77.067,
                "y": 38.907
            },
            "attributes": {
                "Name": "DC Store",
                "SquareFootage": 1300
            }
        }
    ]
}
Example 4: Specifying facilities using URL.

The URL makes a query for a few features from a map service. A URL querying features from a feature service can also be specified.

{
    "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/MapServer/21/query?where=1%3D1&outFields=Name&f=json"
}

token

Use this parameter to specify a token that provides the identity of a user that has the permissions to access the service. Accessing services provided by Esri provides more information on how such an access token can be obtained.

f

Use this parameter to specify the response format. Choose either json or pjson, for example, f=json. The pjson value is used for printing the JSON response in a pretty format.

Optional parameters

travel_mode

Choose the mode of transportation for the analysis.

Travel modes are managed in ArcGIS Online and can be configured by the administrator of your organization to better reflect your organization's workflows. You need to specify the JSON object containing the settings for a travel mode supported by your organization. To get a list of supported travel modes, execute the GetTravelModes tool from the Utilities service.

The value for the travel_mode parameter should be a JSON object representing travel mode settings. When you use the GetTravelModes tool from the Utlities service, You get a string representing the travel mode JSON. You need to convert this string to a valid JSON object using your API and then pass the JSON object as the value for the travel_mode parameter.

For example, below is a string representating the Walking Time travel mode as returned by the GetTravelModes tool.

"{\"attributeParameterValues\": [{\"parameterName\": \"Restriction Usage\", \"attributeName\": \"Walking\", \"value\": \"PROHIBITED\"}, {\"parameterName\": \"Restriction Usage\", \"attributeName\": \"Preferred for Pedestrians\", \"value\": \"PREFER_LOW\"}, {\"parameterName\": \"Walking Speed (km/h)\", \"attributeName\": \"WalkTime\", \"value\": 5}], \"description\": \"Follows paths and roads that allow pedestrian traffic and finds solutions that optimize travel time. The walking speed is set to 5 kilometers per hour.\", \"impedanceAttributeName\": \"WalkTime\", \"simplificationToleranceUnits\": \"esriMeters\", \"uturnAtJunctions\": \"esriNFSBAllowBacktrack\", \"restrictionAttributeNames\": [\"Preferred for Pedestrians\", \"Walking\"], \"useHierarchy\": false, \"simplificationTolerance\": 2, \"timeAttributeName\": \"WalkTime\", \"distanceAttributeName\": \"Miles\", \"type\": \"WALK\", \"id\": \"caFAgoThrvUpkFBW\", \"name\": \"Walking Time\"}"

The above value should be converted to a valid JSON object and passed as the value for the travel_mode parameter

travel_mode={"attributeParameterValues":[{"parameterName":"Restriction Usage","attributeName":"Walking","value":"PROHIBITED"},{"parameterName":"Restriction Usage","attributeName":"Preferred for Pedestrians","value":"PREFER_LOW"},{"parameterName":"Walking Speed (km/h)","attributeName":"WalkTime","value":5}],"description":"Follows paths and roads that allow pedestrian traffic and finds solutions that optimize travel time. The walking speed is set to 5 kilometers per hour.","impedanceAttributeName":"WalkTime","simplificationToleranceUnits":"esriMeters","uturnAtJunctions":"esriNFSBAllowBacktrack","restrictionAttributeNames":["Preferred for Pedestrians","Walking"],"useHierarchy":false,"simplificationTolerance":2,"timeAttributeName":"WalkTime","distanceAttributeName":"Miles","type":"WALK","id":"caFAgoThrvUpkFBW","name":"Walking Time"}

The default value,Custom, allows you to configure your own travel mode. When you pass in Custom, you can set values for the following parameters impedance, uturn_at_junctions, use_hierarchy, polygon_simplification_tolerance, restrictions, and attribute_parameter_values.

The default values of the custom travel mode parameters model travelling by car. You may want to choose Custom and set the custom travel mode parameters listed above to model a pedestrian with a fast walking speed or a truck with a given height, weight, and cargo of certain hazardous materials. You may choose to do this to try out different settings to get desired analysis results. Once you have identified the analysis settings, you should work with your organization's administrator and save these settings as part of new or existing travel mode so that everyone in your organization can rerun the analysis with the same settings.

CautionCaution:

When the travel_mode parameter is not set to Custom, this means you are choosing a travel mode configured by your organization, and the service automatically overrides the values of other parameters with values that model the chosen travel mode. The following parameters are overridden:impedance, uturn_at_junctions, use_hierarchy, polygon_simplification_tolerance, restrictions, and attribute_parameter_values.

If you set travel_mode to Custom, the service honors the default or user-defined values for the related parameters (impedance, uturn_at_junctions, use_hierarchy, restrictions, polygon_simplification_tolerance, and attribute_parameter_values) so you can create your own travel mode.

break_values

Use this parameter to specify the size and number of service areas to generate for each facility. The units are determined by the break_units parameter. If units are time based, the service areas are generated based on travel time along underlying streets. If units are distance based, the service areas are generated based on travel distances.

CautionCaution:

The service imposes a limit of 5 hours (300 minutes) for the largest value that can be specified as the break_values parameter when generating time-based service areas and a limit of 300 miles (482.80 kilometers) when generating distance-based service areas. These limits are reduced to 15 minutes and 15 miles (24.14 kilometers), respectively, when generating detailed polygons (detailed_Polygons = true). If the value is exceeded, the response returns an error message.

Multiple area breaks can be specified to create concentric service areas per facility. For instance, to find 2-, 3-, and 5-mile service areas for each facility, specify break_values=2 3 5, separating the values with a space, and set break_units to Miles.

CautionCaution:

The values should always use a period as the decimal separator, even in countries where a comma is traditionally used.

The default value for this parameter is 5 10 15

break_units

Use this parameter to specify the units for the break_values parameter. The parameter is specified using the following values:

  • Meters
  • Kilometers
  • Feet
  • Yards
  • Miles
  • Nautical Miles
  • Seconds
  • Minutes
  • Hours
  • Days

The default value for this parameter is Minutes.

travel_direction

Use this parameter to specify whether the direction of travel used to generate the service areas is toward or away from the facilities. The parameter is specified using the following values:

  • Away From Facility: The service area is generated in the direction away from the facilities.
  • Towards Facility: The service area is created in the direction towards the facilities.

The direction of travel may change the shape of the service areas because travel times on opposite sides of streets may differ or one-way restrictions may exist, such as one-way streets. The direction you should choose depends on how you want to use service areas in your analysis. The service area for a pizza delivery store, for example, should be created away from the facility, whereas the service area of a hospital should be created toward the facility, since that is the direction in which travel time is critical.

The default value for this parameter is Away From Facility.

time_of_day

Specify whether travel times should consider traffic conditions. To use traffic in the analysis, set break_units to a time unit, and assign a value to time_of_day. The time_of_day value represents the time at which travel begins, or departs, from the input points. The time is specified as Unix time (milliseconds since midnight, January 1 1970).

The interpretation of the parameter value depends on whether travel is toward or away from the facilities as specified by the travel_direction parameter.

  • It represents the departure time if travel_direction is set to Away From Facility. This is the default.
  • It represents the arrival time if travel_direction is set to Towards Facility.

If a time of day is not passed in, the service uses static road speeds based on average historical speeds or posted speed limits. It uses posted speeds in areas where historical traffic information isn't available.

NoteNote:

Traffic is supported only with the driving time impedance or travel mode. It's not supported with trucking.

The service supports two kinds of traffic: typical and live. Typical traffic references travel speeds that are made up of historical averages for each five-minute interval spanning a week. Live traffic retrieves speeds from a traffic feed that processes phone probe records, sensors, and other data sources to record actual travel speeds and predict speeds for the near future.

The Data Coverage page shows the countries Esri currently provides traffic data for.

Typical Traffic:

To ensure the service uses typical traffic in locations where it is available, choose a time and day of the week, and then convert the day of the week to one of the following dates from 1990:

  • Monday—1/1/1990
  • Tuesday—1/2/1990
  • Wednesday—1/3/1990
  • Thursday—1/4/1990
  • Friday—1/5/1990
  • Saturday—1/6/1990
  • Sunday—1/7/1990

Set the time and date as Unix time in milliseconds.

For example, to solve for 1:03 p.m. on Thursdays, set the time and date to 1:03 p.m., 4 January 1990; and convert to milliseconds (631458180000).

NoteNote:

Although the dates representing days of the week are from 1990, typical traffic is calculated from recent traffic trends—usually over the last several months.

Live Traffic:

To use live traffic when and where it is available, choose a time and date and convert to Unix time.

Esri saves live traffic data for 12 hours and references predictive data extending 12 hours into the future. If the time and date you specify for this parameter is outside the 24-hour time window, or the travel time in the analysis continues past the predictive data window, the task falls back to typical traffic speeds.

NoteNote:

  • All points in facilities need to be in the same time zone when using traffic and setting polygons_for_multiple_facilities to Not Overlapping or Merge by Break Value.
  • This parameter is ignored when break_units is set to distance units.
  • The time zone for time_of_day can be UTC or the time zone or zones in which the points in facilities are located. Specify time zones with the time_zone_for_time_of_day parameter.

Examples:

  • "time_Of_Day": 631458180000 // 13:03, 4 January 1990. Typical traffic on Thursdays at 1:03 p.m.
  • "time_Of_Day": 631731600000 // 17:00, 7 January 1990. Typical traffic on Sundays at 5:00 p.m.
  • "time_Of_Day": 1413964800000 // 8:00, 22 October 2014. If the current time is between 8:00 p.m., 21 Oct. 2014 and 8:00 p.m., 22 Oct. 2014, live traffic speeds are referenced in the analysis; otherwise, typical traffic speeds are referenced.
  • "time_Of_Day": 1426674000000 // 10:20, 18 March 2015. If the current time is between 10:20 p.m., 17 Mar. 2015 and 10:20 p.m., 18 Mar. 2015, live traffic speeds are referenced in the analysis; otherwise, typical traffic speeds are referenced.

time_zone_for_time_of_day

Specify the time zone or zones of the time_of_day parameter. There are two options: Geographically Local (default) and UTC.

Geographically Local:

The time_of_day value refers to the time zone or zones in which the input points are located. This option causes the analysis to have rolling start times across time zones.

Geographically Local Illustration: Setting time_of_day to 9:00 a.m., 4 January 1990 (631443600000 milliseconds); time_zone_for_time_of_day to Geographically Local; and submitting a valid request causes the service areas for facilities in the Eastern Time Zone to start at 9:00 a.m. Eastern Time and 9:00 a.m. Central Time for points in the Central Time Zone. (The start times are offset by an hour in real or UTC time.)

Input: time_of_day is 9:00 a.m., 4 Jan. 1990 (631443600000 milliseconds), and time_zone_for_time_of_day is set to Geographically Local

UTC:

The time_of_day value refers to Coordinated Universal Time (UTC). The start times for all points are simultaneous, regardless of time zones.

UTC Illustration: Setting time_of_day to 9:00 a.m., 4 January 1990 (631443600000 milliseconds) and time_zone_for_time_of_day to UTC, the start time for points in the Eastern Time Zone is 4:00 a.m. Eastern Time and 3:00 a.m. Central Time for those in the Central Time Zone.

Input: time_of_day is 9:00 a.m., 4 Jan. 1990 (631443600000 milliseconds), and time_zone_for_time_of_day is set to UTC

use_hierarchy

Specify whether hierarchy should be used when generating service areas.

CautionCaution:

The value of this parameter, regardless of whether you rely on the default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Driving, so unless you set travel_mode to a different value, this parameter value will be overridden.

  • true—Use hierarchy when measuring. When generating hierarchical service areas, the service prefers higher-order streets such as freeways to lower-order streets such as local roads. This means that if a facility is located on a local road (the lowest level in a hierarchy), the service spans out on the local roads in that area, but it tries to step up the hierarchy to secondary and primary roads. Once on secondary and primary roads, the service ignores local roads throughout the rest of the service area. Mainly because of this hierarchical approach, hierarchical service areas are generated much faster as compared to non-hierarchical service areas as the service has to generate service areas from a relatively smaller subset of streets. Hierarchical service areas can be used to simulate the driver preference of traveling on freeways instead of local roads even if that means a longer trip. However, the areas can overlap some lower-order roads that can't truly be reached within the given travel distance or travel time. So hierarchical service areas can be less accurate.

  • true (default)—Don't use hierarchy when measuring. This results in service areas that are measured along all the streets regardless of hierarchy level and tend to be superior in quality as compared to their hierarchical counterparts.

CautionCaution:

The service automatically reverts to using hierarchy, even if you have chosen not to use it, when the largest value specified in the break_values parameter equates to a time or distance that is greater than 240 minutes or 240 miles (386.24 kilometers). If the detailed_polygons parameter is set to true, the service reverts to using hierarchy if the largest break value is greater than 15 minutes or 15 miles.

Some service parameters are not applicable when generating heirarchical service areas.

  • The polygon_trim_distance parameter is ignored and if specified results in a warning message in the service response.
  • Generating detailed service areas, specified using a value of true for the detailed_polygons parameter, are not supported and results in a failed request.

uturn_at_junctions

Use this parameter to restrict or allow the analysis to make U-turns at junctions.

CautionCaution:

The value of this parameter, regardless of whether you rely on the default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Driving, so unless you set travel_mode to a different value, this parameter value will be overridden.

In order to understand the available parameter values, consider for a moment that a junction is a point where only two streets intersect each other. If three or more streets intersect at a point, it is called as an intersection. A cul-de-sac is a dead-end. The parameter can have the following values:

Parameter Value

Description

Allowed

U-turns are permitted everywhere. Allowing U-turns implies that the vehicle can turn around at a junction or intersection and double back on the same street.

U-turns are allowed
U-turns are permitted at junctions with any number of adjacent streets.

Allowed only at Intersections and Dead Ends

U-turns are prohibited at junctions where exactly two adjacent streets meet.

U-turns allowed only at intersections and dead-ends
U-turns are permitted only at intersections or dead ends.

Allowed only at Dead Ends

U-turns are prohibited at all junctions and interesections and are permitted only at dead ends.

U-turns allowed only at dead-ends
U-turns are permitted only at dead ends.

Not Allowed

U-turns are prohibited at all junctions, intersections, and dead-ends. Note that even when this parameter value is chosen, a route can still make U-turns at stops. If you wish to prohibit U-turns at a stop, you can set its CurbApproach property to the appropriate value (3).

The default value for this parameter is Allowed.

polygons_for_multiple_facilities

Use this parameter to specify how to generate service areas when multiple facilities are present. The parameter is specified using one of the following values:

  • Overlapping: Create individual service areas for each facility. The service areas from different facilities can overlap each other.
  • Not Overlapping: Create individual service areas for each facility such that a service area from one facility cannot overlap service areas from other facilities. With this option, the area inside any given service area is closer to the corresponding facility than any other facility.
  • Merge by Break Value: Join the service areas of different facilities that have the same break value. Unlike the Overlapping and Not Overlapping options, this option does not result in individual service areas for each facility.

The default value for this parameter is Overlapping.

polygon_overlap_type

Use this parameter to specify whether multiple service areas around a facility are created as disks or rings. The parameter is specified using one of the following values:

  • Rings: When creating multiple service areas around a facility, do not include the region covered by the smaller service area into the region covered by the larger service area. Use this option if you want to find the area from one break to another. For instance, If you create 5- and 10-minute service areas, then the 10-minute service areas will exclude the area under the 5-minute service areas and thus would appear like rings.
  • Disks: When creating multiple service areas around a facility, creates service areas going from the facility to the break. For instance, If you create 5- and 10-minute service areas, then the 10-minute service area will include the area under the 5-minute service area .
NoteNote:

Using either option will produce the same result when only one break value is specified.

The default value for this parameter is Rings.

detailed_polygons

Use this parameter to specify the option to create detailed or generalized service areas.

A parameter value of true results in creation of detailed service areas and a value of false results in creation of generalized service areas. Detailed service areas model the service areas more accurately and thus may result in islands of unreached areas in certain cases. Generalized service areas are fairly accurate for most cases. However, in some cases, creating generalized service areas may cover islands of unreached areas and would be undesirable if your goal is to find such islands.

If your facilities are in an urban area with a grid like street network, the difference between generalized and detailed service areas would be minimal. However, if your facilities are in a region containing mountain and rural roads, the detailed service areas may present significantly more accurate results than generalized service areas.

CautionCaution:

Detailed service areas are not supported when using hierarchy. So specifying true for the detailed_polygons and the use_hierarchy parameters results in a failed request.

The service supports generating detailed polygons only if the largest value specified in the break_values parameter is up to 15 minutes or 15 miles (24.14 kilometers) when generating time-based or distance-based service areas respectively. If the largest break value is greater than these limits, the service will automatically revert to using hierarchy and will cause a failure since detailed service areas are not supported when using hierarchy.

The default value for this parameter is false.

polygon_trim_distance

Use this parameter to specify the distance within which the service areas are trimmed. This is useful when finding service areas in places that have very sparse street network and you don't want the service area to cover large areas where there are no street features.

The parameter is specified as a JSON structure that includes the following properties:

  • distance: The trim distance value. A 0 distance value specifies that the service areas should not be trimmed.
  • units: The units for the trim distance value. The property value should be specified as one of the following values: esriCentimeters, esriDecimalDegrees, esriDecimeters, esriFeet, esriInches, esriKilometers, esriMeters, esriMiles, esriMillimeters, esriNauticalMiles, esriPoints, and esriYards.

The default value for this parameter is 100 meters. The parameter value is ignored when use_hierarchy parameter is set to true.

Syntax for specifying polygon_trim_distance
{
    "distance": <value>,
    "units": "<unit>"
}
Example: Specifying polygon_trim_distance of 75 meters
{
    "distance": 75,
    "units": "esriMeters"
}

polygon_simplification_tolerance

Use this parameter to specify by how much you want to simplify the service area geometry returned by the service.

NoteNote:

The value of this parameter, regardless of whether you rely on the default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Driving, so unless you set travel_mode to a different value, this parameter value will be overridden.

Simplification maintains critical points of an area to define its essential shape and removes other points. The simplification distance you specify is the maximum allowable offset that the simplified area can deviate from the original area. Simplifying an area reduces the number of points that are used to construct the area and tends to reduce drawing times.

The parameter is specified as a JSON structure that includes the following properties:

  • distance: The simplification distance value.
  • units: The units for the simplification distance value. The property value should be specified as one of the following values: esriCentimeters, esriDecimalDegrees, esriDecimeters, esriFeet, esriInches, esriKilometers, esriMeters, esriMiles, esriMillimeters, esriNauticalMiles, esriPoints, and esriYards.

The default value for this parameter is 10 meters.

Syntax for specifying polygon_simplification_tolerance
{
    "distance": <value>,
    "units": "<unit>"
}
Example: Specifying polygon_simplification_tolerance of 10 meters
{
    "distance": 10,
    "units": "esriMeters"
}

point_barriers

Use this parameter to specify one or more points that act as temporary restrictions or represent additional time or distance that may be required to travel on the underlying streets. For example, a point barrier can be used to represent a fallen tree along a street or time delay spent at a railroad crossing.

CautionCaution:

The service imposes a maximum limit of 250 point barriers. If the value is exceeded, the response returns an error message.

The point_barriers parameter can be specified using a JSON structure that represents a set of features. The JSON structure can include the following properties:

  • url: Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set. This property is optional. However, either features or url must be specified.
  • spatialReference: Specifies the spatial reference for the geometries of point barriers. This property is not required if the coordinate values are in the default spatial reference, WGS84. If the coordinate values are in a different spatial reference, you need to specify the well-known ID (WKID) for the spatial reference. See Geographic coordinate systems and Projected coordinate systems to look up WKID values.
  • features: Specify an array of features. This property is optional. However, either the features or url property must be specified.

Each feature in the features array represents a point barrier and contains the following properties:

  • geometry: Specifies the barrier's geometry as a point containing x and y properties.
  • attributes: Specify each attribute as a key-value pair where the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for point_barriers

When specifying the point_barriers parameter you can specify additional information about barriers, such as the barrier type, using attributes. The point_barriers parameter can be specified with the following attributes:

  • Name: The name of the barrier.
  • BarrierType: Specifies whether the point barrier restricts travel completely or adds time or distance when it is crossed. The value for this attribute is specified as one of the following integers:
    • 0 - Prohibits traversing through the barrier. The barrier is referred to as restriction point barrier since it acts as a restriction. This is the default value.
      Two maps demonstrate how a restriction point barrier affects finding the best route.
      The map on the left shows the shortest path between two stops without any restriction point barriers. The map on the right has a road that is blocked by a fallen tree, so the shortest path between the same points is longer.
    • 2 - Traveling through the barrier increases the travel time or distance by the amount specified as the value for Additional_Time or Additional_Distance attributes. This barrier type is referred to as an added cost point barrier.
      Two maps demonstrate how added cost barriers affect finding the best route.
      The map on the left shows the shortest path between two stops without any added cost point barrier. For the map on the right, the travel time from stop one to stop two would be the same whether going around the north end of the block or the south end; however, since crossing railroad tracks incurs a time penalty (modeled with added cost point barriers), the route with only one railroad crossing is chosen. The cost of crossing the barrier is added to the accumulated travel time of the resulting route.
      NoteNote:

      There is no point barrier type with a value of 1 for the BarrierType attribute.

  • Additional_Time: Indicates how much travel time is added when the barrier is traversed. This attribute is applicable only for added-cost barriers and only if the measurement units are time based. The attribute value must be greater than or equal to zero and is specified in the measurement units.
  • Additional_Distance: Indicates how much distance is added when the barrier is traversed. This attribute is applicable only for added-cost barriers and only if the measurement units are distance based. The attribute value must be greater than or equal to zero and is specified in the measurement units.

Syntax for specifying point_barriers using a JSON structure for features
{
    "spatialReference": {
        "wkid": <wkid>,
        "latestWkid": <wkid>, 
    },
    "features": [
        {
            "geometry": {
                "x": <x1>,
                "y": <y1>,
            },
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>
            }
        },
        {
            "geometry": {
                "x": <x2>,
                "y": <y2>,
            },
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>
            }
        }
    ], 
}
Syntax for specifying point_barriers using a URL returning a JSON response
{
    "url": "<url>"
}
Example 1: Specifying an added cost point barrier in the default spatial reference, WGS84, using JSON structure.

This example shows how to use an added cost point barrier to model a 5-minute delay at a railroad crossing. The BarrierType attribute is used to specify the point barrier is of type added cost and the Additional_Time attribute is used to specify the added delay in minutes. The barrier geometries are in the default spatial reference, WGS84. Hence, the spatialReference property is not specified.

{
    "features": [
        {
            "geometry": {
                "x": 37.541479,
                "y": -122.053461
            },
            "attributes": {
                "Name": "Haley St railroad crossing",
                "BarrrierType": 2,
                "Additional_Time": 5
            }
        }
    ]
}
Example 2: Specifying restriction point barriers in the Web Mercator spatial reference using a JSON structure.

This example shows how to use a restriction point barrier to model a road that is blocked by a fallen tree.The barrier's geometry is in the Web Mercator spatial reference and not in the default WGS84 spatial reference. Hence, the spatialReference property is required.

{
    "spatialReference": {
        "wkid": 102100
    },
    "features": [
        {
            "geometry": {
                "y": -13635398.9398,
                "x": 4544699.034400001
            },
            "attributes": {
                "Name": "Fallen tree at 123 Main St", 
                "BarrierType": 0
            }
        }
    ]
}
Example 3: Specifying point barriers using a URL.

The URL makes a query for a few features from a map service. A URL querying features from a feature service can also be specified.

{
    "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/MapServer/21/query?where=1%3D1&outFields=Name&f=json"
}

line_barriers

Use this parameter to specify one or more lines that prohibit travel anywhere the lines intersect the streets. For example, a parade or protest that blocks traffic across several street segments can be modeled with a line barrier. A line barrier can also quickly fence off several roads from being traversed, thereby channeling possible routes away from undesirable parts of the street network.

Two maps demonstrate how a line barrier affects finding a route between two stops.
The map on the left displays the shortest path between two stops. The map on the right shows the shortest path when several streets are blocked by a line barrier.

CautionCaution:

The service imposes a limit on the number of streets you can restrict using the line_barriers parameter. While there is no limit on number of lines you can specify as line barriers, the combined number of streets intersected by all the lines cannot exceed 500. If the value is exceeded, the response returns an error message.

The line_barriers parameter can be specified using a JSON structure that represents a set of features. The JSON structure can include the following properties:

  • url: Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set. This property is optional. However, either features or url must be specified.
  • spatialReference: Specifies the spatial reference for the geometries of the barriers. This property is not required if the coordinate values are in the default spatial reference, WGS84. If the coordinate values are in a different spatial reference, you need to specify the well-known ID (WKID) for the spatial reference. See Geographic coordinate systems and Projected coordinate systems to look up WKID values.
  • features: Specify an array of features. This property is optional. However, either the features or url property must be specified.

Each feature in the features array represents a line barrier and contains the following properties:

  • geometry: Specifies the barrier's geometry. The structure is based on ArcGIS REST polyline object. A polyline contains an array of paths. Each path is represented as an array of points, and each point in the path is represented as an array of numbers containing X and Y coordinate values at index 0 and 1 respectively.
  • attributes: Specify each attribute as a key-value pair where the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for line_barriers

The line_barriers parameter can be specified with the following attributes:

  • Name: The name of the line barrier.

Syntax for specifying line barriers using a JSON structure for features
{
    "spatialReference": {
        "wkid": <wkid>,
        "latestWkid": <wkid>, 
    },
    "features": [
        {
            "geometry": {
                "paths": [
                    [
                        [
                            <x11>,
                            <y11>
                        ],
                        [
                            <x12>,
                            <y12>
                        ]
                    ],
                    [
                        [
                            <x21>,
                            <y21>
                        ],
                        [
                            <x22>,
                            <y22>
                        ]
                    ]
                ]
            },
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>
            }
        },
		{
            "geometry": {
                "paths": [
                    [
                        [
                            <x11>,
                            <y11>
                        ],
                        [
                            <x12>,
                            <y12>
                        ]
                    ],
                    [
                        [
                            <x21>,
                            <y21>
                        ],
                        [
                            <x22>,
                            <y22>
                        ]
                    ]
                ]
            },
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>
            }
        }
    ], 
}
Syntax for specifying line barriers using a URL returning a JSON response
{
    "url": "<url>"
}
Example 1: Specifying line barriers using a JSON structure in Web Mercator spatial reference.

The example shows how to add two lines as line barriers to restrict travel on the streets intersected by the lines. Barrier 1 is a single-part line feature made up of two points. Barrier 2 is a two-part line feature whose first part is made up of three points and whose second part is made up of two points. The barrier geometries are in the Web Mercator spatial reference and not in the default WGS84 spatial reference. Hence, the spatialReference property is required.

{
    "spatialReference": {
        "wkid": 102100
    },
    "features": [
        {
            "geometry": {
                "paths": [
                    [
                        [
                            -10804823.397,
                            3873688.372
                        ],
                        [
                            -10804811.152,
                            3873025.945
                        ]
                    ]
                ]
            },
            "attributes": {
                "Name": "Barrier 1"
            }
        },
        {
            "geometry": {
                "paths": [
                    [
                        [
                            -10804823.397,
                            3873688.372
                        ],
                        [
                            -10804807.813,
                            3873290.911
                        ],
                        [
                            -10804811.152,
                            3873025.945
                        ]
                    ],
                    [
                        [
                            -10805032.678,
                            3863358.76
                        ],
                        [
                            -10805001.508,
                            3862829.281
                        ]
                    ]
                ]
            },
            "attributes": {
                "Name": "Barrier 2"
            }
        }
    ]
}
Example 2: Specifying line barriers using URL.

The URL makes a query for a few features from a map service. A URL querying features from a feature service can also be specified.

{
    "url": "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/6/query?where=1%3D1&returnGeometry=true&f=json"
}

polygon_barriers

Use this parameter to specify polygons that either completely restrict travel or proportionately scale the time or distance required to travel on the streets intersected by the polygons.

CautionCaution:

The service imposes a limit on the number of streets you can restrict using the polygon_barriers parameter. While there is no limit on number of polygons you can specify as the polygon barriers, the combined number of streets intersected by all the polygons cannot exceed 2,000. If the value is exceeded, the response returns an error message.

The polygon_barriers parameter can be specified using a JSON structure that represents a set of features. The JSON structure can include the following properties:

  • url: Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set. This property is optional. However, either features or url must be specified.
  • spatialReference: Specifies the spatial reference for the geometries of barriers. This property is not required if the coordinate values are in the default spatial reference, WGS84. If the coordinate values are in a different spatial reference, you need to specify the well-known ID (WKID) for the spatial reference. See Geographic coordinate systems and Projected coordinate systems to look up WKID values.
  • features: Specify an array of features. This property is optional. However, either the features or url property must be specified.

Each feature in the features array represents a polygon barrier and contains the following properties:

  • geometry: Specifies the barrier's geometry. The structure is based on ArcGIS REST polygon object. A polygon contains an array of rings. The first point of each ring is always the same as the last point. Each point in the ring is represented as an array of numbers containing X and Y coordinate values at index 0 and 1 respectively.
  • attributes: Specify each attribute as a key-value pair where the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for polygon_barriers

When specifying the polygonBarriers parameter, you can specify additional information about barriers, such as the barrier type, using attributes. The polygon_barriers parameter can be specified with the following attributes:

  • Name: The name of the barrier.
  • BarrierType: Specifies whether the barrier restricts travel completely or scales the time or distance for traveling through it. The value for this attribute is specified as one of the following integers:
    • 0 - Prohibits traveling through any part of the barrier. The barrier is referred to as restriction polygon barrier since it prohibits traveling on streets intersected by the barrier. One use of this type of barrier is to model floods that make traveling on flooded streets impossible. This is the default value.
      Two maps demonstrate how a restriction polygon barrier affects finding a route between two stops.
      The left side depicts the shortest path between two stops. On the right, a polygon barrier blocks flooded streets, so the shortest path between the same two stops is different.
    • 1 - Scales the time or distance required to travel the underlying streets by a factor specified using the ScaledTimeFactor or ScaledDistanceFactor attributes. If the streets are partially covered by the barrier, the travel time or distance is apportioned and then scaled. For example, a factor 0.25 would mean that travel on underlying streets is expected to be four times faster than normal. A factor of 3.0 would mean it is expected to take three times longer than normal to travel on underlying streets. This barrier type is referred to as scaled cost polygon barrier. It might be used to model storms that reduce travel speeds in specific regions.
      Two maps demonstrate how a scaled cost polygon barrier affects finding a route between two stops.
      The map on the left shows a route that goes through inclement weather without regard for the effect poor road conditions have on travel time. On the right, a scaled polygon barrier doubles the travel time of the roads covered by the storm. Notice the route still passes through the southern tip of the storm since it is quicker to spend more time driving slowly through a small part of the storm rather than driving completely around it. The service uses the modified travel time in calculating the best route; furthermore, the modified travel time is reported as the total travel time in the response.
  • ScaledTimeFactor: This is the factor by which the travel time of the streets intersected by the barrier is multiplied. This attribute is applicable only to scaled-cost barriers whose measurement units are time based. The attribute value must be greater than zero. The default value is 1.
  • ScaledDistanceFactor: This is the factor by which the distance of the streets intersected by the barrier is multiplied. This attribute is applicable only to scaled-cost barriers whose measurement units are distance based. The attribute value must be greater than zero. The default value is 1.

Syntax for specifying polygon barriers using a JSON structure for features
{
    "spatialReference": {
        "wkid": <wkid>,
        "latestWkid": <wkid>    
    }
    "features": [
        {
            "geometry": {
                "rings": [
                    [
                        [
                            <x11>,
                            <y11>
                        ],
                        [
                            <x12>,
                            <y12>
                        ],
                        ...,
                        [
                            <x11>,
                            <y11>
                        ]
                    ],
                    [
                        [
                            <x21>,
                            <y21>
                        ],
                        [
                            <x22>,
                            <y22>
                        ],
                        ...,
                        [
                            <x21>,
                            <y21>
                        ]
                    ]
                ]
            },
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>
            }
        },
        {
            "geometry": {
                "rings": [
                    [
                        [
                            <x11>,
                            <y11>
                        ],
                        [
                            <x12>,
                            <y12>
                        ],
                        ...,
                        [
                            <x11>,
                            <y11>
                        ]
                    ],
                    [
                        [
                            <x21>,
                            <y21>
                        ],
                        [
                            <x22>,
                            <y22>
                        ],
                        ...,
                        [
                            <x21>,
                            <y21>
                        ]
                    ]
                ]
            },
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>
            }
        }
    ]
}
Syntax for specifying polygon barriers using a URL returning a JSON response
{
    "url": "<url>"
}
Example 1: Specifying polygon barriers using a JSON structure.

The example shows how to add two polygons as barriers. The first polygon named Flood zone is a restriction polygon barrier that prohibits travel on the underlying streets. The polygon is a single-part polygon feature made up of four points. The second polygon named Severe weather zone is a scaled-cost polygon barrier that increases the travel time on underlying streets to one third of the original value. The polygon is a two-part polygon feature. Both parts are made up of four points.

The barrier geometries are in the default spatial reference, WGS84. Hence, the spatialReference property is not required.

{
    "features": [
        {
            "geometry": {
                "rings": [
                    [
                        [
                            -97.0634,
                            32.8442
                        ],
                        [
                            -97.0554,
                            32.84
                        ],
                        [
                            -97.0558,
                            32.8327
                        ],
                        [
                            -97.0638,
                            32.83
                        ],
                        [
                            -97.0634,
                            32.8442
                        ]
                    ]
                ]
            },
            "attributes": {
                "Name": "Flood zone",
                "BarrierType": 0
            }
        },
        {
            "geometry": {
                "rings": [
                    [
                        [
                            -97.0803,
                            32.8235
                        ],
                        [
                            -97.0776,
                            32.8277
                        ],
                        [
                            -97.074,
                            32.8254
                        ],
                        [
                            -97.0767,
                            32.8227
                        ],
                        [
                            -97.0803,
                            32.8235
                        ]
                    ],
                    [
                        [
                            -97.0871,
                            32.8311
                        ],
                        [
                            -97.0831,
                            32.8292
                        ],
                        [
                            -97.0853,
                            32.8259
                        ],
                        [
                            -97.0892,
                            32.8279
                        ],
                        [
                            -97.0871,
                            32.8311
                        ]
                    ]
                ]
            },
            "attributes": {
                "Name": "Severe weather zone",
                "BarrierType": 1,
                "ScaledTimeFactor": 3
            }
        }
    ]
}
Example 2: Specifying a polygon barrier using a URL.

The URL makes a query for a few features from a map service. A URL querying features from a feature service can also be specified.

{
    "url": "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/7/query?where=1%3D1&returnGeometry=true&f=json"
}

restrictions

Use this parameter to specify which restrictions should be honored by the service. A restriction represents a driving preference or requirement. In most cases, restrictions cause roads or pathways to be prohibited, but they can also cause them to be avoided or preferred. For instance, using an Avoid Toll Roads restriction will result in a route that will include toll roads only when it is absolutely required to travel on toll roads in order to visit a stop. Height Restriction makes it possible to route around any clearances that are lower than the height of your vehicle. If you are carrying corrosive materials on your vehicle, using the Any Hazmat Prohibited restriction prevents hauling the materials along roads where it is marked as illegal to do so.

CautionCaution:

The value of this parameter, regardless of whether you rely on the default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Driving, so unless you set travel_mode to a different value, this parameter value will be overridden.

The service supports the restriction names listed in the following table:

NoteNote:

Some restrictions are supported only in certain countries as indicated by the Availability column in the table. A restriction is supported in a country if the Logistics Attribute column has a value of Yes in the list of supported countries. If you specify restriction names that are not available in the country where your input points are located, the service ignores the invalid restrictions and returns warning messages indicating the names for the restrictions that were not considered when making measurements.

NoteNote:

Sometimes you need to specify an additional value, the restriction attribute parameter, on a restriction to get the intended results. This value needs to be associated with the restriction name and a restriction parameter using attribute_parameter_values.

Restriction Name

Description

Availability

Any Hazmat Prohibited

The route will exclude roads where transporting any kind of hazardous material is prohibited.

Select countries in North America and Europe

Avoid Carpool Roads

The route will avoid roads designated exclusively for carpool (high-occupancy) vehicles.

All countries

Avoid Express Lanes

The route will avoid roads designated as express lanes.

All countries

Avoid Ferries

The route will avoid ferries.

All countries

Avoid Gates

The route will avoid roads where there are gates, such as keyed-access or guard-controlled entryways.

All countries

Avoid Limited Access Roads

The route will avoid roads designated as limited-access highways.

All countries

Avoid Private Roads

The route will avoid roads that are not publicly owned and maintained.

All countries

Avoid Toll Roads

The route will avoid toll roads.

All countries

Avoid Unpaved Roads

The route will avoid roads that are not paved (for example, dirt, gravel, etc.).

All countries

Avoid Truck Restricted Roads

The route will avoid roads where trucks are not allowed except when making deliveries.

All countries

Axle Count Restriction

The route will not include roads where trucks with the specified number of axles are prohibited. The number of axles can be specified using the Number of Axles restriction parameter.

Select countries in North America and Europe

Driving a Bus

The route will exclude roads where buses are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Driving a Delivery Vehicle

The route will exclude roads where delivery vehicles are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Driving a Taxi

The route will exclude roads where taxis are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Driving a Truck

The route will exclude roads where trucks are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Driving an Automobile

The route will exclude roads where automobiles are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Driving an Emergency Vehicle

The route will exclude roads where emergency vehicles are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Height Restriction

The route will exclude roads where the vehicle height exceeds the maximum allowed height for the road. The vehicle height can be specified using the Vehicle Height (meters) restriction parameter.

Select countries in North America and Europe

Kingpin to Rear Axle Length Restriction

The route will exclude roads where the vehicle kingpin-to-rear-axle length exceeds the maximum allowed for the road. The vehicle's length between the vehicle kingpin and the rear axle can be specified using the Vehicle Kingpin to Rear Axle Length (meters) restriction parameter.

Select countries in North America and Europe

Length Restriction

The route will exclude roads where the vehicle length exceeds the maximum allowed length for the road. The vehicle length can be specified using the Vehicle Length (meters) restriction parameter.

Select countries in North America and Europe

Preferred for Pedestrians

The route prefers paths designated for pedestrians.

All countries

Riding a Motorcycle

The route will exclude roads where motorcycles are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Roads Under Construction Prohibited

The route will exclude roads that are under construction.

All countries

Semi or Tractor with One or More Trailers Prohibited

The route will exclude roads where semis or tractors with one or more trailers are prohibited.

Select countries in North America and Europe

Single Axle Vehicles Prohibited

The route will exclude roads where vehicles with single axles are prohibited.

Select countries in North America and Europe

Tandem Axle Vehicles Prohibited

The route will exclude roads where vehicles with tandem axles are prohibited.

Select countries in North America and Europe

Through Traffic Prohibited

The route will exclude roads where through traffic (non-local) is prohibited.

All countries

Truck with Trailers Restriction

The route will exclude roads where trucks with the specified number of trailers on the truck are prohibited. The number of trailers on the truck can be specified using the Number of Trailers on Truck restriction parameter.

Select countries in North America and Europe

Use Preferred Hazmat Routes

The route will prefer roads designated for transporting any kind of hazardous materials.

Select countries in North America and Europe

Use Preferred Truck Routes

The route will prefer roads designated as truck routes, such as the roads that are part of the national network as specified by the National Surface Transportation Assistance Act in the United States, or roads that are designated as truck routes by the state or province, or or roads in an area that are generally more suitable for trucks.

Select countries in North America and Europe

Walking

The route will exclude roads where pedestrians are prohibited.

All countries

Weight Restriction

The route will exclude roads where the vehicle weight exceeds the maximum allowed weight for the road. The vehicle weight can be specified using the Vehicle Weight (kilograms) restriction parameter.

Select countries in North America and Europe

Weight per Axle Restriction

The route will exclude roads where the vehicle's weight per axle exceeds the maximum allowed for the road. The vehicle's weight per axle can be specified using the Vehicle Weight per Axle (kilograms) restriction parameter.

Select countries in North America and Europe

Width Restriction

The route will roads where the vehicle width exceeds the maximum allowed for the road. The vehicle width can be specified using the Vehicle Width(meters) restriction parameter.

Select countries in North America and Europe

LegacyLegacy:

Driving a Delivery Vehicle restriction attribute is deprecated and will be unavailable in future releases. To achieve similar results, use Driving a Truck restriction attribute along with Avoid Truck Restricted Roads restriction attribute.

The restrictions parameter value is specified as an array of restriction names. The default value for this parameter is restrictions=[Avoid Carpool Roads, Avoid Express Lanes, Avoid Gates, Avoid Private Roads, Avoid Unpaved Roads, Driving an Truck, Use Preferred Truck Routes, Roads Under Construction Prohibited, Through Traffic Prohibited]. A value of null indicates that no restrictions should be used when finding the best route, but only when travel_mode is set to Custom.

Example: restrictions=[Driving an Emergency Vehicle,Height Restriction,Length Restriction]

attribute_parameter_values

Use this parameter to specify additional values required by an attribute or restriction, such as to specify whether the restriction prohibits, avoids, or prefers travel on restricted roads. If the restriction is meant to avoid or prefer roads, you can further specify the degree to which they are avoided or preferred using this parameter.

CautionCaution:

The value of this parameter, regardless of whether you rely on its default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Custom.

The attributes_parameter_values parameter can be specified using a JSON structure that represents a set of features. The JSON structure can include the following properties:

  • url: Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set. This property is optional. However, either features or url must be specified.
  • features: Specify an array of features. This property is optional. However, either the features or url property must be specified.

Each feature in the features array represents an attribute parameter and contains the following properties:

  • attributes: Specify each attribute as a key-value pair where the key is the name of a given field, and the value is the attribute value for the corresponding field.
NoteNote:

The JSON structure for the attribute_parameter_values parameter does not have a geometry property.

Attributes for attribute_parameter_values

The attribute_parameter_values parameter can be specified with the following attributes:

  • AttributeName: Lists the name of the restriction.
  • ParameterName: Lists the name of the parameter associated with the restriction. A restriction can have one or more ParameterName values based on its intended use, which implies you may need multiple attribute_parameter_values parameters for a single attribute name.
  • ParameterValue: The value for the ParameterName that is used by the service when evaluating the restriction.

NoteNote:

In most cases, the attribute_parameter_values parameter is dependent on the restrictions parameter. The ParameterValue specified as part of attribute_parameter_values is applicable only if the restriction name is specified as the value for the restrictions parameter.

When specifying the attribute_parameter_values parameter, each restriction (listed as AttributeName) has a ParameterName value, Restriction Usage, that specifies whether the restriction prohibits, avoids, or prefers travel on the roads associated with the restriction and the degree to which the roads are avoided or preferred.

The Restriction Usage ParameterName can be assigned any of the following string values or their equivalent numeric values listed within the parentheses:

  • PROHIBITED (-1)—Travel on the roads using the restriction is completely prohibited.
  • AVOID_HIGH (5)—It is very unlikely for the service to include, in the results, roads that are associated with the restriction.
  • AVOID_MEDIUM (2)—It is unlikely for the service to include, in the results, roads that are associated with the restriction.
  • AVOID_LOW (1.3)—It is somewhat unlikely for the service to include, in the results, roads that are associated with the restriction.
  • PREFER_LOW (0.8)—It is somewhat likely for the service to include, in the results, results roads that are associated with the restriction.
  • PREFER_MEDIUM(0.5)—It is likely for the service to include, in the results, roads that are associated with the restriction.
  • PREFER_HIGH (0.2)—It is very likely for the service to include, in the results, roads that are associated with the restriction.

In most cases, you can use the default value, PROHIBITED, for Restriction Usage if the restriction is dependent on a physical vehicle characteristic, such as vehicle height. However, in some cases, the value for Restriction Usage depends on your travel preferences. For example, the Avoid Toll Roads restriction has the default value of AVOID_MEDIUM for the Restriction Usage parameter. This means that when the restriction is used, the service will try to route around toll roads when it can. AVOID_MEDIUM also indicates how important it is to avoid toll roads when finding the best route; it has a medium priority. Choosing AVOID_LOW would put lower importance on avoiding tolls; choosing AVOID_HIGH instead would give it a higher importance and thus make it more acceptable for the service to generate longer routes to avoid tolls. Choosing PROHIBITED would entirely disallow travel on toll roads, making it impossible for a route to travel on any portion of a toll road. Keep in mind that avoiding or prohibiting toll roads, and thus avoiding toll payments, is the objective for some; in contrast, others prefer to drive on toll roads because avoiding traffic is more valuable to them than the money spent on tolls. In the latter case, you would choose PREFER_LOW, PREFER_MEDIUM, or PREFER_HIGH as the value for Restriction Usage. The higher the preference, the farther the service will go out of its way to travel on the roads associated with the restriction.

The following table lists the restriction names and the default restriction parameter values for all the restrictions. The default value for the attribute_parameter_values parameter is the JSON structure containing all the rows from the table.

TipTip:

If you want to use the default value for any restriction, AttributeName, ParameterName, and ParameterValue do not have to be specified as part of the attribute_parameter_values parameter.

AttributeName

ParameterName

ParameterValue

Any Hazmat Prohibited

Restriction Usage

PROHIBITED

Avoid Carpool Roads

Restriction Usage

AVOID_HIGH

Avoid Express Lanes

Restriction Usage

AVOID_HIGH

Avoid Ferries

Restriction Usage

AVOID_MEDIUM

Avoid Gates

Restriction Usage

AVOID_MEDIUM

Avoid Limited Access Roads

Restriction Usage

AVOID_MEDIUM

Avoid Private Roads

Restriction Usage

AVOID_MEDIUM

Avoid Toll Roads

Restriction Usage

AVOID_MEDIUM

Avoid Truck Restricted Roads

Restriction Usage

AVOID_HIGH

Axle Count Restriction

Number of Axles

0

Restriction Usage

PROHIBITED

Driving a Bus

Restriction Usage

PROHIBITED

Driving a Delivery Vehicle

Restriction Usage

PROHIBITED

Driving a Taxi

Restriction Usage

PROHIBITED

Driving a Truck

Restriction Usage

PROHIBITED

Driving an Automobile

Restriction Usage

PROHIBITED

Driving an Emergency Vehicle

Restriction Usage

PROHIBITED

Height Restriction

Restriction Usage

PROHIBITED

Vehicle Height (meters)

0

Kingpin to Rear Axle Length Restriction

Restriction Usage

PROHIBITED

Vehicle Kingpin to Rear Axle Length (meters)

0

Length Restriction

Restriction Usage

PROHIBITED

Vehicle Length (meters)

0

Riding a Motorcycle

Restriction Usage

PROHIBITED

Roads Under Construction Prohibited

Restriction Usage

PROHIBITED

Semi or Tractor with One or More Trailers Prohibited

Restriction Usage

PROHIBITED

Single Axle Vehicles Prohibited

Restriction Usage

PROHIBITED

Tandem Axle Vehicles Prohibited

Restriction Usage

PROHIBITED

Through Traffic Prohibited

Restriction Usage

AVOID_HIGH

Truck with Trailers Restriction

Restriction Usage

PROHIBITED

Number of Trailers on Truck

0

Use Preferred Hazmat Routes

Restriction Usage

PREFER_MEDIUM

Use Preferred Truck Routes

Restriction Usage

PREFER_HIGH

Walking

Restriction Usage

PROHIBITED

WalkTime

Walking Speed (km/h)

5

Weight Restriction

Restriction Usage

PROHIBITED

Vehicle Weight (kilograms)

0

Weight per Axle Restriction

Restriction Usage

PROHIBITED

Vehicle Weight per Axle (kilograms)

0

Width Restriction

Restriction Usage

PROHIBITED

Vehicle Width (meters)

0

Syntax for specifying attribute_parameter_values
{
    "features": [
        {
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>,
                "<field3>": <value13>

            }
        },
        {
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>,
                "<field3>": <value13>
            }
        }
    ] 
}
Example: Specifying the vehicle height and weight and a high preference to use designated truck routes

This example shows how to specify the height and weight of the vehicle for use with the height and weight restrictions respectively along with a high preference to include designated truck routes. This results in a route that does not include any roads where the clearance under overpasses or through tunnels is less than the vehicle height. The results will also not include any roads with load limited bridges or local roads that prohibit heavy vehicles if the vehicle weight exceeds the maximum permissible weight. However, the route will include as many roads as possible that are designated as preferred truck routes.

Note that the Restriction Usage ParameterName for the Height Restriction and the Weight Restriction restrictions are not specified since we want to use the default value of PROHIBITED for these restriction parameters.

attribute_parameter_values=
{
    "features": [
        {
            "attributes": {
                "AttributeName": "Height Restriction",
                "ParameterName": "Vehicle Height (meters)",
                "ParameterValue": 4.12
            }
        },
        {
            "attributes": {
                "AttributeName": "Weight Restriction",
                "ParameterName": "Vehicle Weight (kilograms)",
                "ParameterValue": 36287
            }
        },
        {
            "attributes": {
                "AttributeName": "Use Preferred Truck Routes",
                "ParameterName": "Restriction Usage",
                "ParameterValue": "PREFER_HIGH"
            }
        }
    ]
}

impedance

Specify the impedance.

CautionCaution:

The value of this parameter, regardless of whether you rely on its default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Custom.

Impedance is a value that quantifies travel along the transportation network. Travel distance is an example of impedance; it quantifies the length of walkways and road segments. Similarly, drive time—the typical time it takes to drive a car along a road segment—is an example of impedance. Drive times may vary by type of vehicle—for instance, the time it takes for a truck to travel along a path tends to be longer than a car—so there can be many impedance values representing travel times for different vehicle types. Impedance values may also vary with time; live and historical traffic reference dynamic impedance values. Each walkway and road segment stores at least one impedance value. When performing a network analysis, the impedance values are used to calculate the best results, such as finding the shortest route—the route that minimizes impedance—between two points.

The impedance parameter can be specified using the following values:

  • Drive Time—Models travel times for a car. These travel times can be dynamic, fluctuating according to traffic flows, in areas where traffic data is available.
  • Truck Time (default)—Models travel times for a truck. These travel times are static for each road and don't fluctuate with traffic.
  • Walk Time—Models travel times for a pedestrian. The default walking speed is 5 kilometers per hour (3.1 miles per hour), but you can change that speed through the attribute_parameter_values parameter by setting Walking Speed (km/h) to a different value.
  • Travel Distance—Stores length measurements along roads and paths. To model walk distance, set impedance to Travel Distance and make sure to pass in the restriction parameter with the Walking restriction, which helps ensure the only paths traveled on allow pedestrian traffic. Similarly, to model car or truck distance, set impedance to Travel Distance and set appropriate values for the restrictions and attribute_parameter_values parameters. This will help ensure your vehicle travels only on roads where it is permitted to do so.

If you pass Drive Time, Truck Time, or Walk Time, the measurement_units parameter must be set to a time-based value; if you set impedance to Travel Distance, measurement_units must be distance-based.

analysis_region

Specify the region in which to perform the analysis. If a value is not specified for this parameter, the tool will automatically calculate the region name based on the location of the input points. Setting the name of the region is recommended to speed up the tool execution. To specify a region, use one of the following values:

  • Europe
  • Greece
  • India
  • Japan
  • Korea
  • MiddleEastAndAfrica
  • NorthAmerica
  • Oceania
  • SouthAmerica
  • SouthAsia
  • SouthEastAsia
  • Taiwan
  • Thailand

The data coverage page lists the countries that are grouped into each of these regions.

env:outSR

Use this parameter to specify the spatial reference of the service area geometries returned by the service.

The parameter value can be specified as a well-known ID (WKID) for the spatial reference. If env:outSR is not specified, the geometries are returned in the default spatial reference, WGS84. See Geographic coordinate systems and Projected coordinate systems to look up WKID values.

Many of the basemaps provided by ArcGIS Online are in the Web Mercator spatial reference (WKID 102100). Specifying env:outSR=102100 returns the geometries in the Web Mercator spatial reference, which can be drawn on top of the basemaps.

save_output_network_analysis_layer

Use this parameter to specify if the service should save the analysis settings as a network analysis layer file. You cannot directly work with this file even when you open the file in an ArcGIS Desktop application like ArcMap. It is meant to be sent to Esri Technical Support in order to diagnose the quality of results returned from the service.

  • true—Saves network analysis layer file. The file can be downloaded from the URL provided as part of the output_network_analysis_layer parameter.

  • false—Don't save network analysis layer file. This is the default value.

overrides

Specify additional settings that can influence the behavior of the solver when finding solutions for the network analysis problems.

The value for this parameter needs to be specified in JavaScript Object Notation (JSON). The values can be either a number, Boolean, or a string.

{
"overrideSetting1" : "value1", 
"overrideSetting2" : "value2"
}

The default value for this parameter is no value, which indicates not to override any solver settings.

Overrides are advanced settings that should be used only after careful analysis of the results obtained before and after applying the settings. A list of supported override settings for each solver and their acceptable values can be obtained by contacting Esri Technical Support.

JSON Response

When you submit a request, the service assigns a unique job ID for the transaction. The job ID and the status of the job are returned in the response.

JSON response syntax from the request
{
    "jobId": <jobID>,
    "jobStatus": <jobStatus>
}

The jobStatus property can have the following values:

You can use the job ID to periodically check the status of the job and messages. Additionally, if the job has successfully completed, you can use the job ID to retrive the results or even the inputs. The job information and results remain available for 24 hours after the job is done.

After the initial request is submitted, you can make a request of the following form to get the status of the job:

http://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas/jobs/<yourJobID>/?token=<yourToken>&returnMessages=true&f=json

JSON response syntax during job execution
{
    "jobId": "<jobId>",
    "jobStatus": "<jobStatus>",
    "messages": [
        {
            "type": "<type1>",
            "description": "<description1>"
        },
        {
            "type": "<type2>",
            "description": "<description2>"
        }
    ]
}

While a job is executing, you can cancel it by making a request of the form

http://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas/jobs/<yourJobID>/cancel?token=<yourToken>&f=json

NoteNote:

When you submit your request, If the service is busy processing other requests, the job will wait in the queue. The job status will be reported as esriJobSubmitted. If your application cannot wait for the entire duration while the job is in the queue, you can cancel the request and submit it again later. A canceled request will not incur any service credits. However, if your application did not cancel the request, it will eventually execute and will incur service credits, irrespective of whether your application retrived the results or ignored them. Hence, your application should always cancel the request if required.

After the successful completion of the job, you can make a request of the following form to retrieve the outputs. Refer to the Output Parameters section below for more information on how to interpret the solution provided by the service.

http://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas/jobs/<yourJobID>/results/<output_parameter_name>?token=<yourToken>&f=json

You can also retrieve the value for any input parameter by making the requests of the the following form:

http://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas/jobs/<yourJobID>/inputs/<inputParameterName>?token=<yourToken>&f=json

Output parameters

Upon successful execution, the service returns the service areas around the facilities and the status indicating the analysis was successful by using the service_areas and solve_succeeded output parameters.

service_areas

Use this parameter to get the area that can be reached from the input location within a given travel time or travel distance. The polygon_overlap_type, polygons_for_multiple_facilities, polygon_trim_distance, and the polygon_simplification_tolerance parameters highly influence the shape of the output service areas. The service area geometries are returned in the spatial reference specified as the env:outSR parameter.

The following provides a description of fields that are returned for each service area:

  • ObjectID: A unique identifier for the service area. This identifier is auto generated by the service.
  • Name: The name of the service area is based on the name of the associated facility and the break range; for instance, Store1: 0.0 – 5.0 represents a service area that covers all traversable streets within five minutes of a facility named Store1. The break values are returned without the name of the facility, for example, 0.0 – 5.0, when polygons_for_multiple_facilities is set to Merge by Break Value.
  • FacilityName: The name of the facility the service area was created around. These field values are copied from the Name field of the input facilities. However, multiple facilities may be associated with one service area when polygons_for_multiple_facilities is set to Merge by Break Value; therefore, FacilityName is excluded from the results when service areas are merged.
  • FacilityID: The unique identifier of the associated facility. FacilityID contains an auto-generated identifier. Multiple facilities may be associated with one service area when polygons_for_multiple_facilities is set to Merge by Break Value; therefore, FacilityID field values are set to null or -1 when service areas are merged.
  • FacilityOID: The ObjectID value of the input facility feature used to generate the service area polygon. Multiple facilities may be associated with one service area when polygons_for_multiple_facilities is set to Merge by Break Value; therefore, FacilityOID field values are set to null or -1 when service areas are merged.
  • FromBreak: The lower bound of the service area's break range. The value is in the units specified by the break_units parameter.
  • ToBreak: The upper bound of the service area's break range. The value is in the units specified by the break_units parameter.
  • If Merge by Break Value wasn't used, the output also includes any fields you added to the input facilities.

The service_areas parameter is returned as a JSON feature set with following syntax:

CautionCaution:

The service can return a maximum of 10,000 features with the service_areas output parameter. If your request generates more than 10,000 features, you will only get the first 10,000 features in the response. In such cases, the exceededTransferLimit property will be set to true.

{
    "paramName": "Service_Areas",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {
        "displayFieldName": "",
        "geometryType": "esriGeometryPolygon",
        "spatialReference": {
            "wkid": <wkid>,
            "latestWkid": <wkid>,
            
        },
        "fields": [
            {
                "name": "<field1Name>",
                "type": "<field1Type>",
                "alias": "<field1Alias>",
                "length": "<field1Length>" //length is included only for esriFieldTypeString
            },
            {
                "name": "<field2Name>",
                "type": "<field2Type>",
                "alias": "<field2Alias>",
                "length": "<field2Length>"
            }
        ],
        "features": [
        {
            "geometry": {
                "rings": [
                    [
                        [
                            <x11>,
                            <y11>
                        ],
                        [
                            <x12>,
                            <y12>
                        ],
                        ...,
                        [
                            <x11>,
                            <y11>
                        ]
                    ],
                    [
                        [
                            <x21>,
                            <y21>
                        ],
                        [
                            <x22>,
                            <y22>
                        ],
                        ...,
                        [
                            <x21>,
                            <y21>
                        ]
                    ]
                ]
            },
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>
            }
        },
        {
            "geometry": {
                "rings": [
                    [
                        [
                            <x11>,
                            <y11>
                        ],
                        [
                            <x12>,
                            <y12>
                        ],
                        ...,
                        [
                            <x11>,
                            <y11>
                        ]
                    ],
                    [
                        [
                            <x21>,
                            <y21>
                        ],
                        [
                            <x22>,
                            <y22>
                        ],
                        ...,
                        [
                            <x21>,
                            <y21>
                        ]
                    ]
                ]
            },
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>
            }
        }
    ],
        "exceededTransferLimit": <true|false>
    }
}

The following shows an example of the service_areas parameter.

NoteNote:

Because the response is quite verbose, the repeated elements within the response are abbreviated for clarity.

{
    "paramName": "Service_Areas",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {
        "displayFieldName": "",
        "geometryType": "esriGeometryPolygon",
        "spatialReference": {
            "wkid": 4326,
            "latestWkid": 4326
        },
        "fields": [
            {
                "name": "ObjectID",
                "type": "esriFieldTypeOID",
                "alias": "ObjectID"
            },
            {
                "name": "FacilityID",
                "type": "esriFieldTypeInteger",
                "alias": "FacilityID"
            },
            {
                "name": "Name",
                "type": "esriFieldTypeString",
                "alias": "Name",
                "length": 128
            },
            {
                "name": "FromBreak",
                "type": "esriFieldTypeDouble",
                "alias": "FromBreak"
            },
            {
                "name": "ToBreak",
                "type": "esriFieldTypeDouble",
                "alias": "ToBreak"
            },
            {
                "name": "FacilityOID",
                "type": "esriFieldTypeInteger",
                "alias": "FacilityOID"
            },
            {
                "name": "FacilityName",
                "type": "esriFieldTypeString",
                "alias": "Name",
                "length": 128
            },
            {
                "name": "Shape_Length",
                "type": "esriFieldTypeDouble",
                "alias": "Shape_Length"
            },
            {
                "name": "Shape_Area",
                "type": "esriFieldTypeDouble",
                "alias": "Shape_Area"
            }
        ],
        "features": [
            {
                "attributes": {
                    "ObjectID": 1,
                    "FacilityID": 1,
                    "Name": "Facility 1 : 5 - 10",
                    "FromBreak": 5,
                    "ToBreak": 10,
                    "FacilityOID": 1,
                    "FacilityName": "Facility 1",
                    "Shape_Length": 0.62070029717646258,
                    "Shape_Area": 0.0033515430829082126
                },
                "geometry": {
                    "rings": [
                        [
                            [
                                -0.17744255103286832,
                                51.558202743861614
                            ],
                            [
                                -0.17631721496746877,
                                51.557527541862612
                            ],
                            //...additional points in the polygon ring
                        ],
                        [
                            [
                                -0.19568443269037061,
                                51.539964676228863
                            ],
                            [
                                -0.19658470172254283,
                                51.53816032413971
                            ],
                            //...additional points in the polygon ring
                        ]
                    ]
                }
            },
            {
                "attributes": {
                    "ObjectID": 2,
                    "FacilityID": 1,
                    "Name": "Facility 1 : 0 - 5",
                    "FromBreak": 0,
                    "ToBreak": 5,
                    "FacilityOID": 1,
                    "FacilityName": "Facility 1",
                    "Shape_Length": 0.16771059350061351,
                    "Shape_Area": 0.00094631728859383775
                },
                "geometry": {
                    "rings": [
                        [
                            [
                                -0.18937839999313155,
                                51.540412800310548
                            ],
                            [
                                -0.18847760036089767,
                                51.54018760017766
                            ],
                            //...additional points in the polygon ring
                        ]
                    ]
                }
            },
            //...additional polygon features
        ],
        "exceededTransferLimit": false
    }
}

solve_succeeded

Use this parameter to determine if the service was able to successfully find the service areas. The error messages for the failure can be obtained by making a request to get the status of the job.

The solve_succeeded parameter is returned as a JSON feature set with following syntax:

{
    "paramName": "Solve_Succeeded",
    "dataType": "GPBoolean",
    "value": <true | false>
}

The following shows an example of the solve_succeeded parameter:

{
    "paramName": "Solve_Succeeded",
    "dataType": "GPBoolean",
    "value": true
}

Usage limits

The table below lists the limits that apply to this service.

Limit Description

Limit Value

Maximum number of facilities:

1,000

Maximum number of (point) barriers:

250

Maximum number of street features intersected by polyline barriers:

500

Maximum number of street features intersected by polygon barriers:

2,000

Maximum number of breaks specified in defaultBreaks:

No limit

Maximum defaultBreaks time:

5 hours (300 minutes)

15 minutes when generating detailed polygons

Maximum defaultBreaks distance:

300 miles (482.80 kilometers)

15 miles (24.14 kilometers) when generating detailed polygons

Force hierarchy beyond a defaultBreaks time of:

(If you specify a defaultBreaks drive time that exceeds the limit shown here, the analysis steps up the hierarchy even if useHierarchy is set to false.)

240 minutes

Force hierarchy beyond a defaultBreaks distance of:

(If you specify a defaultBreaks drive distance that exceeds the limit shown here, the analysis steps up the hierarchy even if useHierarchy is set to false.)

240 miles (386.24 kilometers)

Maximum snap tolerance:

(If the distance between an input point and its nearest traversable street is greater than the distance specified here, the point is excluded from the analysis.)

12.42 miles (20 kilometers)

Maximum number of polygon features that can be returned by the asynchronous service:

10,000

Maximum time a client can use the asynchronous service area service:

1 hour (3,600 seconds)

Examples

NoteNote:

If you copy and paste the request URL from the examples into a web browser, you will get an invalid token error message. You need to replace <yourToken> with a valid token. See Accessing services provided by Esri to see how to generate one.

Calculate 5-, 10-, 15-minute drive time polygons around store locations

This example shows how to calculate the 5-, 10-, 15-minute drive time polygons around a store. The store location is specified as the facilities parameter. The drive-time polygons need to be drawn on an ArcGIS Online basemap that uses the Web Mercator spatial reference. Hence, the env:outSR parameter is specified with a value of 102100 to return polygon geometries in the appropriate spatial reference. The default values for all the other parameters are appropriate for this request and are not specified.

Request URL

https://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas/submitJob?token=<yourToken>&facilities={"features":[{"geometry":{"x":-122.253,"y":37.757},"attributes":{"Name":"Store5689"}}]}&env:outSr=102100&f=json

JSON Response

{
    "jobId": "j54d8cee6384e45a594cc9f8fbc4697f3",
    "jobStatus": "esriJobSubmitted"
}

Request URL to query job status

The job ID obtained from the response of the first request can be queried periodically to determine the status of the job.

https://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas/jobs/<yourJobID>/?token=<yourToken>&f=json

JSON response

{
    "jobId": "j54d8cee6384e45a594cc9f8fbc4697f3",
    "jobStatus": "esriJobSucceeded",
    "results": {
        "Service_Areas": {
            "paramUrl": "results/Service_Areas"
        },
        "Solve_Succeeded": {
            "paramUrl": "results/Solve_Succeeded"
        }
    },
    "inputs": {
        "Facilities": {
            "paramUrl": "inputs/Facilities"
        },
        "Break_Values": {
            "paramUrl": "inputs/Break_Values"
        },
        "Break_Units": {
            "paramUrl": "inputs/Break_Units"
        },
        "Analysis_Region": {
            "paramUrl": "inputs/Analysis_Region"
        },
        "Travel_Direction": {
            "paramUrl": "inputs/Travel_Direction"
        },
        "Time_of_Day": {
            "paramUrl": "inputs/Time_of_Day"
        },
        "Use_Hierarchy": {
            "paramUrl": "inputs/Use_Hierarchy"
        },
        "UTurn_at_Junctions": {
            "paramUrl": "inputs/UTurn_at_Junctions"
        },
        "Polygons_for_Multiple_Facilities": {
            "paramUrl": "inputs/Polygons_for_Multiple_Facilities"
        },
        "Polygon_Overlap_Type": {
            "paramUrl": "inputs/Polygon_Overlap_Type"
        },
        "Detailed_Polygons": {
            "paramUrl": "inputs/Detailed_Polygons"
        },
        "Polygon_Trim_Distance": {
            "paramUrl": "inputs/Polygon_Trim_Distance"
        },
        "Polygon_Simplification_Tolerance": {
            "paramUrl": "inputs/Polygon_Simplification_Tolerance"
        },
        "Point_Barriers": {
            "paramUrl": "inputs/Point_Barriers"
        },
        "Line_Barriers": {
            "paramUrl": "inputs/Line_Barriers"
        },
        "Polygon_Barriers": {
            "paramUrl": "inputs/Polygon_Barriers"
        },
        "Restrictions": {
            "paramUrl": "inputs/Restrictions"
        },
        "Attribute_Parameter_Values": {
            "paramUrl": "inputs/Attribute_Parameter_Values"
        }
    },
    "messages": []
}

Request URL to return the output service areas

Because the job succeeded, you can make a request to return the service areas from the service_areas output parameter.

https://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas/jobs/<yourJobID>/results/service_areas?token=<yourToken>&f=pjson

JSON response

The response contains three drive time areas around the store location. The name of the store and the break range is used to construct the Name attribute for each drive time area. The drive time area geometries are returned in the Web Mercator spatial reference.

NoteNote:

Because the response is quite verbose, the repeated elements within the response are abbreviated for clarity.

{
    "paramName": "Service_Areas",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {
        "displayFieldName": "",
        "geometryType": "esriGeometryPolygon",
        "spatialReference": {
            "wkid": 102100,
            "latestWkid": 3857
        },
        "fields": [
            {
                "name": "ObjectID",
                "type": "esriFieldTypeOID",
                "alias": "ObjectID"
            },
            {
                "name": "FacilityID",
                "type": "esriFieldTypeInteger",
                "alias": "FacilityID"
            },
            {
                "name": "Name",
                "type": "esriFieldTypeString",
                "alias": "Name",
                "length": 128
            },
            {
                "name": "FromBreak",
                "type": "esriFieldTypeDouble",
                "alias": "FromBreak"
            },
            {
                "name": "ToBreak",
                "type": "esriFieldTypeDouble",
                "alias": "ToBreak"
            },
            {
                "name": "FacilityOID",
                "type": "esriFieldTypeInteger",
                "alias": "FacilityOID"
            },
            {
                "name": "FacilityName",
                "type": "esriFieldTypeString",
                "alias": "Name",
                "length": 128
            },
            {
                "name": "Shape_Length",
                "type": "esriFieldTypeDouble",
                "alias": "Shape_Length"
            },
            {
                "name": "Shape_Area",
                "type": "esriFieldTypeDouble",
                "alias": "Shape_Area"
            }
        ],
        "features": [
            {
                "attributes": {
                    "ObjectID": 1,
                    "FacilityID": 1,
                    "Name": "Store5689 : 10 - 15",
                    "FromBreak": 10,
                    "ToBreak": 15,
                    "FacilityOID": 1,
                    "FacilityName": "Store5689",
                    "Shape_Length": 186829.46238855206,
                    "Shape_Area": 101157487.56126754
                },
                "geometry": {
                    "rings": [
                        [
                            [
                                -13609000.5407,
                                4557625.0921000019
                            ],
                            [
                                -13609011.581599999,
                                4557630.4697000012
                            ],
                            //... additional points in the polygon ring
                        ],
                        [
                            [
                                -13609000.5407,
                                4557625.0921000019
                            ],
                            [
                                -13608886.309799999,
                                4557567.0144999996
                            ],
                            //... additional points in the polygon ring
                        ],
                        //... additional rings in the polygon            
                    ]
                }
            },
            {
                "attributes": {
                    "ObjectID": 2,
                    "FacilityID": 1,
                    "Name": "Store5689 : 5 - 10",
                    "FromBreak": 5,
                    "ToBreak": 10,
                    "FacilityOID": 1,
                    "FacilityName": "Store5689",
                    "Shape_Length": 98556.221615700371,
                    "Shape_Area": 45188876.257299371
                },
                "geometry": {
                    "rings": [
                        [
                            [
                                -13610967.0956,
                                4551187.9716000035
                            ],
                            [
                                -13610942.041099999,
                                4551061.1401000023
                            ],
                            //... additional points in the polygon ring
                        ],
                        [
                            [
                                -13611418.2863,
                                4546620.322300002
                            ],
                            [
                                -13611451.621300001,
                                4546606.3554000035
                            ],
                            //... additional points in the polygon ring
                        ],
                        //... additional rings in the polygon
                    ]
                }
            },
            {
                "attributes": {
                    "ObjectID": 3,
                    "FacilityID": 1,
                    "Name": "Store5689 : 0 - 5",
                    "FromBreak": 0,
                    "ToBreak": 5,
                    "FacilityOID": 1,
                    "FacilityName": "Store5689",
                    "Shape_Length": 21281.354678039555,
                    "Shape_Area": 11623189.162529219
                },
                "geometry": {
                    "rings": [
                        [
                            [
                                -13609262.337400001,
                                4547603.4253999963
                            ],
                            [
                                -13609237.2831,
                                4547476.6374000013
                            ],
                            //... additional points in the polygon ring
                        ]
                    ]
                }
            }
        ],
        "exceededTransferLimit": false
    }
}
7/27/2017