Job request

Location-allocation helps you choose which facilities from a set of facilities to operate based on their potential interaction with demand points. It can help you answer questions like the following:

  • Given a set of existing fire stations, which site for a new fire station would provide the best response times for the community?
  • If a retail company has to downsize, which stores should it close to maintain the most overall demand?
  • Where should a factory be built to minimize the distance to distribution centers?

In these examples, facilities would represent the fire stations, retail stores, and factories; demand points would represent buildings, customers, and distribution centers.

The objective may be to minimize the overall distance between demand points and facilities, maximize the number of demand points covered within a certain distance of facilities, maximize an apportioned amount of demand that decays with increasing distance from a facility, or maximize the amount of demand captured in an environment of friendly and competing facilities.

Request URL

This service uses the job request. When using the job request, the client must periodically check whether the service has finished execution and, once completed, get the result. While the service is executing, the application is available to do other things.

You can make a job request to the location-allocation service using the following form:

https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/submitJob?parameters

Request parameters

The location-allocation request takes the parameters listed below. The only required parameters are facilities , demand_points , token , and f . The optional parameters have default values that are used when not specified in the request.

ParameterDescription

facilities

(Required)

Specify one or more locations that serve as facilities.

Syntax:

demand_points

(Required)

Specify one or more demand points.

Syntax:

token

(Required)

Provide the identity of a user who has permissions to access the service.

f

(Required)

Specify the response format.

Values: json | pjson

travel_mode

(Optional)

Specify the mode of transportation for the analysis.

Value: JSON object

measurement_units

(Optional)

Specify the units that will be used to measure the travel times or travel distances between demand points and facilities.

The default value is Minutes .

Values: Meters | Kilometers | Feet | Yards | Miles | NauticalMiles | Seconds | Minutes | Hours | Days

analysis_region

(Optional)

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.

Values: see list

problem_type

(Optional)

Specify the objective of the location-allocation analysis.

The default value is Minimize Impedance .

Values: Minimize Impedance | Maximize Coverage | Maximize Capacitated Coverage | Minimize Facilities | Maximize Attendance | Maximize Market Share | Target Market Share

number_of_facilities_to_find

(Optional)

Specify the number of facilities the task will find. The default value is demonstrated in the example below:

Use dark colors for code blocksCopy
1
number_of_facilities_to_find=1

default_measurement_cutoff

(Optional)

Specify the maximum travel time or distance allowed between a demand point and the facility to which it is allocated. If a demand point is outside the cutoff of a facility, it cannot be allocated to that facility.

The default value is None .

default_capacity

(Optional)

This parameter is specific to the Maximize Capacitated Coverage problem type and is ignored for all other problem types. The default value is demonstrated in the example below:

Use dark colors for code blocksCopy
1
default_capacity=1

target_market_share

(Optional)

This parameter is specific to the Target Market Share problem type and is ignored for all other problem types. The default value is demonstrated in the example below:

Use dark colors for code blocksCopy
1
target_market_share=10

measurement_transformation_model

(Optional)

Set the equation for transforming the network cost between facilities and demand points.

The default value is Linear .

Values: Linear | Power | Exponential

measurement_transformation_factor

(Optional)

Provide an impedance parameter value (λ) to the equation specified in the impedance_transformation_model parameter. The default value is demonstrated in the example below:

Use dark colors for code blocksCopy
1
measurement_transformation_factor=1

travel_direction

(Optional)

Specify whether travel times or distances will be measured from facilities to demand points or from demand points to facilities.

The default value is Facility to Demand .

Values: Facility to Demand | Demand to Facility

time_of_day

(Optional)

Specify the time at which travel begins, or departs, from the starting locations.

time_zone_for_time_of_day

(Optional)

Specify the time zone or zones of the time_of_day parameter.

The default value is Geographically Local .

Values: Geographically Local | UTC

uturn_at_junctions

(Optional)

Restrict or allow the analysis to make U-turns at junctions.

The default value is Allowed only at Intersections and Dead Ends .

Values: Allowed only at Intersections and Dead Ends | Allowed | Allowed Only at Dead Ends | Not Allowed

point_barriers

(Optional)

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.

Syntax:

line_barriers

(Optional)

Specify one or more lines that prohibit travel anywhere the lines intersect the streets.

Syntax:

polygon_barriers

(Optional)

Specify polygons that either prohibit travel or proportionately scale the time or distance required to travel on the streets intersected by the polygons.

Syntax:

use_hierarchy

(Optional)

Specify whether hierarchy will be used when finding the shortest paths.

The default value is true .

Values: true | false

restrictions

(Optional)

Specify the restrictions that will be honored by the service. To learn about the accepted values, see the restrictions section below.

Use dark colors for code blocksCopy
1
restrictions=Avoid Carpool Roads, Avoid Express Lanes, Avoid Gates, Avoid Private Roads, Avoid Unpaved Roads, Driving a Truck, Use Preferred Truck Routes, Roads Under Construction Prohibited, Through Traffic Prohibited

attribute_parameter_values

(Optional)

Specify additional values required by an attribute or restriction, such as whether the restriction prohibits, avoids, or prefers travel on restricted roads. To learn about the accepted values for this parameter, see the attribute_parameter_values section below.

impedance

(Optional)

Specify the impedance.

Values: TravelTime | Minutes | TruckTravelTime | TruckMinutes | WalkTime | Miles | Kilometers

allocation_line_shape

(Optional)

Specify the type of line features that will be output by the tool.

The default value is Straight Line .

Values: Straight Line | None

save_output_network_analysis_layer

(Optional)

Specify whether the service will save the analysis settings as a network analysis layer file.

The default value is false .

Values: true | false

overrides

(Optional)

time_impedance

(Optional)

Specify the time-based impedance.

The default value is TravelTime .

Values: TravelTime | Minutes | TruckTravelTime | TruckMinutes | WalkTime

distance_impedance

(Optional)

Specify the distance-based impedance.

The default value is Kilometers .

Values:Miles | Kilometers

output_format

(Optional)

Specify the format in which the output features will be created.

The default value is Feature Set .

Values: Feature Set | JSON File | GeoJSON File

env:outSR

(Optional)

Specify the spatial reference of the geometries, such as the chosen facilities or the allocation lines returned by the service.

ignore_invalid_locations

(Optional)

Specify whether invalid input locations will be ignored.

The default value is true .

Values: true | false

locate_settings

(Optional)

Specify settings that affect how inputs are located.

Value: JSON object

Required parameters

facilities

Use this parameter to specify one or more locations that serve as facilities. This service identifies the best facility or facilities to serve the demand points.

The facilities parameter can be specified using a JSON structure that represents a set of point features. The property is optional; however, the JSON structure must specify either the url or features property:

  • url —Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set.

  • features —Specify an array of features.

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

    • geometry —Specify the input point geometry containing x and y properties along with the spatialReference property. If the spatialReference property is defined for the entire JSON, you don't need to define this property for each geometry. Doing so reduces the size of the input JSON if the input has many features and improves performance. This property is not required if the coordinates are in the default spatial reference, WGS84. If the coordinates are in a different spatial reference, you must specify the spatial reference's well-known ID (WKID). See Using spatial references to look up WKID values.

    • attributes —Specify each attribute as a key-value pair in which the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for facilities

When defining the facilities, you can set properties for each one, such as the facility name or type, using attributes. Facilities can be specified with the following fields:

  • Name

    The name of the facility. The name is included in the name of output allocation lines if the facility is part of the solution.

  • FacilityType

    Specifies whether the facility is a candidate, required, or a competitor facility. The field value is specified as one of the following integers (use the numeric code, not the name in parentheses):

    • 0 (Candidate)—A facility that may be part of the solution.
    • 1 (Required)—A facility that must be part of the solution.
    • 2 (Competitor)—A rival facility that potentially removes demand from your facilities. Competitor facilities are specific to the Maximize Market Share and Target Market Share problem types; they are ignored in other problem types.
  • Weight

    The relative weighting of the facility, which is used to rate the attractiveness, desirability, or bias of one facility compared to another.

    For example, a value of 2.0 could capture the preference of customers who prefer, at a ratio of 2 to 1, shopping in one facility over another facility. Factors that potentially affect facility weight include square footage, neighborhood, and age of the building. Weight values other than one are only honored by the maximize market share and target market share problem types; they are ignored in other problem types.

  • Cutoff

    The impedance value at which to stop searching for demand points from a given facility. The demand point can't be allocated to a facility that is beyond the value indicated here.

    This attribute allows you to specify a different cutoff value for each demand point. For example, You might find that people in rural areas are willing to travel up to 10 miles to reach a facility, while urbanites are only willing to travel up to 2 miles. You can model this behavior by setting the Cutoff value for all demand points that are in rural areas to 10 and setting the Cutoff value of the demand points in urban areas to 2.

  • Capacity

    The Capacity field is specific to the Maximize Capacitated Coverage problem type; the other problem types ignore this field.

    Capacity specifies how much weighted demand the facility is capable of supplying. Excess demand won't be allocated to a facility even if that demand is within the facility's default measurement cutoff.

    Any value assigned to the Capacity field overrides the Default Capacity parameter (Default_Capacity in Python) for the given facility.

  • CurbApproach

    Specify the direction a vehicle can arrive at and depart from the facility.

    One of the integers listed in the Coded value column in the following table must be specified as a value of this attribute. The values in the Setting column are the descriptive names for CurbApproach attribute values that you may have seen when using the ArcGIS Network Analyst extension software.

    SettingCoded valueDescription

    Either side of vehicle

    0

    The vehicle can approach and depart the facility in either direction, so a U-turn is allowed at the facility. This setting can be chosen if it is possible and desirable for a vehicle to turn around at the facility. This decision may depend on the width of the road and the amount of traffic or whether the facility has a parking lot where vehicles can pull in and turn around.

    Either side of vehicle

    All arrival and departure combinations are allowed with the Either side of vehicle curb approach.

    Right side of vehicle

    1

    When the vehicle approaches and departs the facility, the facility must be on the right side of the vehicle. A U-turn is prohibited. This is typically used for vehicles such as buses that must arrive with the bus stop on the right-hand side.

    Right side of vehicle

    The allowed arrival and departure combination for the Right side of vehicle curb approach is shown.

    Left side of vehicle

    2

    When the vehicle approaches and departs the facility, the facility must be on the left side of the vehicle. A U-turn is prohibited. This is typically used for vehicles such as buses that must arrive with the bus stop on the left side.

    Left side of vehicle

    The allowed arrival and departure combination for the Left side of vehicle curb approach is shown.

    No U-Turn

    3

    When the vehicle approaches the facility, the facility can be on either side of the vehicle; however, when it departs, the vehicle must continue in the same direction it arrived. A U-turn is prohibited.

    No U-turns

    The allowed arrival and departure combinations for the No U-Turn curb approach are shown.

    The CurbApproach attribute is designed to work with both types of national driving standards: right-hand traffic (United States) and left-hand traffic (United Kingdom). First, consider an incident on the left side of a vehicle. It is always on the left side regardless of whether the vehicle travels on the left or right half of the road. What may change with national driving standards is your decision to approach an incident from one of two directions, that is, so it ends up on the right or left side of the vehicle. For example, if you want to arrive at an incident and not have a lane of traffic between the vehicle and the incident, choose 1 (Right side of vehicle) in the United States and 2 (Left side of vehicle) in the United Kingdom.

     Right side of vehicle with right-hand traffic

    With right-hand traffic, the curb approach that leaves the vehicle closest to the facility is Right side of vehicle.

     Left side of vehicle with left-hand traffic

    With left-hand traffic, the curb approach that leaves the vehicle closest to the facility is Left side of vehicle.

  • Bearing

    The direction in which a point is moving. The units are degrees and are measured clockwise from true north. This field is used in conjunction with the BearingTol field.

    Bearing data is usually sent automatically from a mobile device equipped with a GPS receiver. Try to include bearing data if you are loading an input location that is moving, such as a pedestrian or a vehicle.

    Using this field tends to prevent adding locations to the wrong edges, which can occur when a vehicle is near an intersection or an overpass, for example. Bearing also helps the tool determine on which side of the street the point is.

    Learn more about bearing and bearing tolerance

  • BearingTol

    The bearing tolerance value creates a range of acceptable bearing values when locating moving points on an edge using the Bearing field. If the Bearing field value is within the range of acceptable values that are generated from the bearing tolerance on an edge, the point can be added as a network location there; otherwise, the closest point on the next-nearest edge is evaluated.

    The units are in degrees, and the default value is 30. Values must be greater than 0 and less than 180. A value of 30 means that when Network Analyst attempts to add a network location on an edge, a range of acceptable bearing values is generated 15 degrees to either side of the edge (left and right) and in both digitized directions of the edge.

    Learn more about bearing and bearing tolerance

  • NavLatency

    This field is only used in the solve process if the Bearing and BearingTol fields also have values; however, entering a NavLatency field value is optional, even when values are present in Bearing and BearingTol . NavLatency indicates how much cost is expected to elapse from the moment GPS information is sent from a moving vehicle to a server and the moment the processed route is received by the vehicle's navigation device.

    The units of NavLatency are the same as the units of the impedance attribute.

Syntax examples for facilities

The following is syntax for specifying facilities using a JSON structure for features:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "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>
      }
    }
  ]
}

The following is syntax for specifying facilities using a URL returning a JSON response:

Use dark colors for code blocksCopy
1
2
3
{
  "url": "<url>"
}

Examples for facilities

Example 1: Specifying facilities in the same spatial reference as your network dataset using a JSON structure. The example also shows how to specify some attributes for the incidents.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "features": [
    {
      "geometry": {
        "y": 51.5254,
        "x": -0.1891
      },
      "attributes": {
        "Name": "Facility 1",
        "ID": "F100045",
        "Capacity": 100,
        "CurbApproach": 0
      }
    },
    {
      "geometry": {
        "y": 51.5353,
        "x": -0.1744
      },
      "attributes": {
        "Name": "Facility 2",
        "ID": "F100086",
        "Capacity": 150,
        "CurbApproach": 0
      }
    }
  ]
}

Example 2: Specifying facilities in the Web Mercator spatial reference using a JSON structure

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
  "spatialReference": {
    "wkid": 102100
  },
  "features": [
    {
      "geometry": {
        "y": -5192521.476,
        "x": -2698533.989
      },
      "attributes": {
        "Name": "123 Main St",
        "ID": "200156",
        "FacilityType": 0
      }
    },
    {
      "geometry": {
        "y": -5191915.261,
        "x": -2697821.094
      },
      "attributes": {
        "Name": "845 Cypress Ave",
        "ID": "300242",
        "FacilityType": 0
      }
    }
  ]
}

Example 3: Specifying facilities 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.

Use dark colors for code blocksCopy
1
2
3
{
    "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/MapServer/21/query?where=1%3D1&outFields=Name&f=json"
}

demand_points

Use this parameter to specify one or more demand points. The service identifies the best facilities based in large part on how the facilities serve the demand points specified.

You can specify the demand_points parameter using a JSON structure that represents a set of point features. The property is optional; however, the JSON structure must specify either the url or features property:

  • url —Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set.

  • features —Specify an array of features.

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

    • geometry —Specify the input point geometry containing x and y properties along with the spatialReference property. If the spatialReference property is defined for the entire JSON, you don't need to define this property for each geometry. Doing so reduces the size of the input JSON if the input has many features and improves performance. This property is not required if the coordinates are in the default spatial reference, WGS84. If the coordinates are in a different spatial reference, you must specify the spatial reference's well-known ID (WKID). See Using spatial references to look up WKID values.

    • attributes —Specify each attribute as a key-value pair in which the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for demand_points

When defining the demand points, you can set properties for each, such as the demand point name or weight, using attributes. Demand points can be specified with the following fields:

  • Name

    The name of the demand point. The name is included in the name of an output allocation line or lines if the demand point is part of the solution.

  • GroupName

    The name of the group to which the demand point belongs. This field is ignored for the Maximize Capacitated Coverage, Target Market Share, and Maximize Market Share problem types.

    If demand points share a group name, the solver allocates all members of the group to the same facility. (If constraints, such as a cutoff distance, prevent any of the demand points in the group from reaching the same facility, none of the demand points are allocated.)

    Minimizing distance without group names

    Minimize distance without grouped demand points.

    Minimizing distance with group names

    Minimize distance with grouped demand points. In this example, the yellow demand points have the same GroupName value, so they are allocated to the same facility.

  • Weight

    The relative weighting of the demand point. A value of 2.0 means the demand point is twice as important as one with a weight of 1.0. If demand points represent households, for example, weight could indicate the number of people in each household.

  • Cutoff

    The impedance value at which to stop searching for demand points from a given facility. The demand point can't be allocated to a facility that is beyond the value indicated here.

    This attribute allows you to specify a cutoff value for each demand point. For example, you may find that people in rural areas are willing to travel up to 10 miles to reach a facility, while those in urban areas are only willing to travel up to 2 miles. You can model this behavior by setting the Cutoff value for all demand points that are in rural areas to 10 and setting the Cutoff value of the demand points in urban areas to 2.

    The units for this attribute value are specified by the measurement_units parameter.

    A value for this attribute overrides the default set for the analysis using the default_measurement_cutoff parameter. The default value is Null , which results in the default value set by the default_measurement_cutoff parameter being used for all the demand points.

  • ImpedanceTransformation

    Override the default value set for the analysis by the measurement_transformation_model parameter.

  • ImpedanceParameter

    Override the default value set for the analysis by the measurement_transformation_model parameter.

  • CurbApproach

    Specify the direction a vehicle can arrive at or depart from the demand point. One of the integers listed in the Coded value column in the following table must be specified as a value of this attribute. The values in the Setting column are the descriptive names for the CurbApproach attribute values that you may have seen when using the ArcGIS Network Analyst extension software.

    SettingCoded valueDescription

    Either side of vehicle

    0

    The vehicle can approach and depart the demand point in either direction.

    Either side of vehicle

    All arrival and departure combinations are allowed with the Either side of vehicle curb approach.

    Right side of vehicle

    1

    When the vehicle approaches or departs the demand point, the demand point must be on the right side of the vehicle. This is typically used for vehicles such as buses that must arrive with the bus stop on the right side.

    Right side of vehicle

    The allowed arrival and departure combination for the Right side of vehicle curb approach is shown.

    Left side of vehicle

    2

    When the vehicle approaches or departs the demand point, the demand point must be on the left side of the vehicle. This is typically used for vehicles such as buses that must arrive with the bus stop on the left side.

    Left side of vehicle

    The allowed arrival and departure combination for the Left side of vehicle curb approach is shown.

    No U-Turn

    3

    When the vehicle approaches the demand point, the demand point can be on either side of the vehicle; however, when it departs, the vehicle must continue in the same direction it arrived in. A U-turn is prohibited.

    No U-turns

    The allowed arrival and departure combinations for the No U-Turn curb approach are shown.

    The CurbApproach property is designed to work with both types of national driving standards: right-hand traffic (United States) and left-hand traffic (United Kingdom). First, consider a demand point on the left side of a vehicle. It is always on the left side regardless of whether the vehicle travels on the left or right half of the road. What may change with national driving standards is your decision to approach a demand point from one of two directions, that is, so it ends up on the right or left side of the vehicle. For example, if you want to arrive at a demand point and not have a lane of traffic between the vehicle and the demand point, you would choose 1 (Right side of vehicle) in the United States and 2 (Left side of vehicle) in the United Kingdom.

     Right side of vehicle with right-hand traffic

    With right-hand traffic, the curb approach that leaves the vehicle closest to the demand point is Right side of vehicle.

     Left side of vehicle with left-hand traffic

    With left-hand traffic, the curb approach that leaves the vehicle closest to the demand point is Left side of vehicle.

  • Bearing

    The direction in which a point is moving. The units are degrees and are measured clockwise from true north. This field is used in conjunction with the BearingTol field.

    Bearing data is usually sent automatically from a mobile device equipped with a GPS receiver. Try to include bearing data if you are loading an input location that is moving, such as a pedestrian or a vehicle.

    Using this field tends to prevent adding locations to the wrong edges, which can occur when a vehicle is near an intersection or an overpass, for example. Bearing also helps the tool determine on which side of the street the point is.

    Learn more about bearing and bearing tolerance

  • BearingTol

    The bearing tolerance value creates a range of acceptable bearing values when locating moving points on an edge using the Bearing field. If the Bearing field value is within the range of acceptable values that are generated from the bearing tolerance on an edge, the point can be added as a network location there; otherwise, the closest point on the next-nearest edge is evaluated.

    The units are in degrees, and the default value is 30. Values must be greater than 0 and less than 180. A value of 30 means that when Network Analyst attempts to add a network location on an edge, a range of acceptable bearing values is generated 15 degrees to either side of the edge (left and right) and in both digitized directions of the edge.

    Learn more about bearing and bearing tolerance

  • NavLatency

    This field is only used in the solve process if the Bearing and BearingTol fields also have values; however, entering a NavLatency field value is optional, even when values are present in Bearing and BearingTol . NavLatency indicates how much cost is expected to elapse from the moment GPS information is sent from a moving vehicle to a server and the moment the processed route is received by the vehicle's navigation device.

    The units of NavLatency are the same as the units of the impedance attribute.

Syntax examples for demand_points

The following is syntax for specifying demand points using a JSON structure for features:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "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>
      }
    }
  ]
}

The following is syntax for specifying demand points using a URL returning a JSON response:

Use dark colors for code blocksCopy
1
2
3
{
  "url": "<url>"
}

Examples for demand_points

Example 1: Specifying demand points in the spatial reference of the network dataset using a JSON structure. The example also shows how to specify some attributes for the demand points.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "features": [
    {
      "geometry": {
        "y": 51.5254,
        "x": -0.1891
      },
      "attributes": {
        "Name": "Customer 1",
        "ID": "C00001",
        "Weight": 10,
        "CurbApproach": 0
      }
    },
    {
      "geometry": {
        "y": 51.5353,
        "x": -0.1744
      },
      "attributes": {
        "Name": "Customer 2",
        "ID": "C00002",
        "Weight": 7,
        "CurbApproach": 1
      }
    }
  ]
}

Example 2: Specifying demand points in the Web Mercator spatial reference using a JSON structure

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
  "spatialReference": {
    "wkid": 102100
  },
  "features": [
    {
      "geometry": {
        "y": -5192521.476,
        "x": -2698533.989
      },
      "attributes": {
        "Name": "Patron 1",
        "ID": "P1",
        "TimeCutoff": 10,
      }
    },
    {
      "geometry": {
        "y": -5191915.261,
        "x": -2697821.094
      },
      "attributes": {
        "Name": "Patron 2",
        "ID": "P2",
        "TimeCutoff": 15,
      }
    }
  ]
}

Example 3: Specifying demand points 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.

Use dark colors for code blocksCopy
1
2
3
{
    "url": "https://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. The security and authentication page provides more information about how an access token can be obtained.

Use dark colors for code blocksCopy
1
token=<yourToken>

f

Use this parameter to specify the response format. The parameter can have json or pjson as arguments, for example, f=json . The pjson value is used for printing the JSON response in a prettified format.

Optional parameters

The following parameters are optional:

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 the organization's workflows.

Learn more about travel modes

You must 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 Utilities 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 representing the Walking Time travel mode as returned by the GetTravelModes tool.

Use dark colors for code blocksCopy
1
"{\"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.

Use dark colors for code blocksCopy
1
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 , time_impedance , distance_impedance , uturn_at_junctions , use_hierarchy , route_line_simplification_tolerance , restrictions , and attribute_parameter_values . You can choose Custom and set the custom travel mode parameters listed above, for example, to model a pedestrian with a fast walking speed or a truck with a given height, weight, and cargo of certain hazardous materials. You can 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.

The default values of the custom travel mode parameters model traveling by car. If you specify the travel mode as Custom or do not provide a value for the travel_mode parameter, the analysis will be similar to using the default Driving Time travel mode.

measurement_units

Specify the units that will be used to measure the travel times or travel distances between demand points and facilities. The service finds the best facilities based on those that can reach, or be reached by, the most amount of weighted demand with the least amount travel.

The output allocation lines report travel distance or travel time in different units, including the units you specify for this parameter.

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

analysis_region

Specify the region in which to perform the analysis. If a value is not specified for this parameter, the service 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 analysis.

To specify a region, use one of the following values:

  • Europe
  • Japan
  • Korea
  • MiddleEastAndAfrica
  • NorthAmerica
  • SouthAmerica
  • SouthAsia
  • Thailand

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

problem_type

Specifies the objective of the location-allocation analysis, which can be one of the following options. The default objective is to minimize impedance.

Minimize Impedance

Minimize Impedance problem type

Minimize Impedance chooses facilities such that the sum of weighted impedances (demand allocated to a facility multiplied by the impedance to the facility) is minimized.

This is also known as the P-Median problem type. Facilities are located such that the sum of all weighted travel time or distance between demand points and solution facilities is minimized. (Weighted travel is the amount of demand allocated to a facility multiplied by the travel distance or time to the facility.)

This problem type is traditionally used to locate warehouses, because it can reduce the overall transportation costs of delivering goods to outlets. Since Minimize Impedance reduces the overall distance the public needs to travel to reach the chosen facilities, the minimize impedance problem without an impedance cutoff is ordinarily regarded as more equitable than other problem types for locating some public-sector facilities such as libraries, regional airports, museums, department of motor vehicles offices, and health clinics.

The following list describes how the minimize impedance problem type handles demand:

  • A demand point that cannot reach any facilities, due to setting a cutoff distance or time, is not allocated.
  • A demand point that can only reach one facility has all its demand weight allocated to that facility.
  • A demand point that can reach two or more facilities has all its demand weight allocated to the nearest facility only.

Maximize Coverage

Maximize Coverage problem type

Maximize Coverage chooses facilities such that as much demand as possible is covered by the impedance cutoff of facilities. In this graphic, the task was directed to choose three facilities.

Facilities are located such that as much demand as possible is allocated to solution facilities within the impedance cutoff.

Maximize Coverage is frequently used to locate fire stations, police stations, and Emergency Response Services (ERS) centers, because emergency services are often required to arrive at all demand points within a specified response time. Note that it is important for all organizations, and critical for emergency services, to have accurate and precise data so that analysis results correctly model real-world results.

Pizza delivery businesses, as opposed to eat-in pizzerias, try to locate stores where they can cover the most people within a certain drive time. People who order pizzas for delivery don't typically worry about how far away the pizzeria is; they are mainly concerned with the pizza arriving within an advertised time window. Therefore, a pizza delivery business would subtract pizza preparation time from its advertised delivery time and solve a maximize coverage problem to choose the candidate facility that would capture the most potential customers in the coverage area. (Potential customers of eat-in pizzerias are more affected by distance, since they need to travel to the restaurant; thus, the attendance maximizing or market share problem types would better suit eat-in restaurants.)

The following list describes how the Maximize Coverage problem handles demand:

  • A demand point that cannot reach any facilities due to cutoff distance or time is not allocated.
  • A demand point that can only reach one facility has all its demand weight allocated to that facility.
  • A demand point that can reach two or more facilities has all its demand weight allocated to the nearest facility only.

Maximize Capacitated Coverage

Maximize Capacitated Coverage problem type

Maximize Capacitated Coverage chooses facilities such that all or the greatest amount of demand can be served without exceeding the capacity of any facility. In this graphic, each facility has a capacity of one, and the task was directed to choose three facilities. Although the demand point on the bottom of the map is within the impedance cutoff of a facility, it's not allocated, because doing so would surpass a facility's capacity.

Facilities are located such that all or the greatest amount of demand can be served without exceeding the capacity of any facility.

Maximize Capacitated Coverage behaves like either the Minimize Impedance or Maximize Coverage problem type but with the added constraint of capacity. You can specify a capacity for an individual facility by assigning a numeric value to its corresponding Capacity attribute on the input facilities. If the Capacity attribute value is null, the facility is assigned a capacity from the default_capacity property.

Use cases for Maximize Capacitated Coverage include creating territories that encompass a given number of people or businesses, locating hospitals or other medical facilities with a limited number of beds or patients who can be treated, or locating warehouses whose inventory isn't assumed to be unlimited.

The following list describes how the Maximize Capacitated Coverage problem handles demand:

  • Unlike Maximize Coverage, Maximize Capacitated Coverage doesn't require a value for the Default Measurement Cutoff; however, when a cutoff is specified, any demand point outside the cutoff time or distance of all facilities is not allocated.
  • An allocated demand point has all or none of its demand weight assigned to a facility; that is, demand isn't apportioned with this problem type.
  • If the total demand that can reach a facility is greater than the capacity of the facility, only the demand points that maximize total captured demand and minimize total weighted travel are allocated.

Minimize Facilities

Minimize Facilities problem type

Minimize Facilities chooses facilities such that as many demand points as possible are within the impedance cutoff of facilities. Additionally, the number of facilities required to cover all demand points is minimized. In this graphic, the task was able to cover all demand points with only two facilities.

Facilities are chosen such that as much weighted demand as possible is allocated to solution facilities within the travel time or distance cutoff; additionally, the number of facilities required to cover demand is minimized.

Minimize Facilities is the same as Maximize Coverage but with the exception of the number of facilities to locate, which in this case is determined by the solver. When the cost of building facilities is not a limiting factor, the same kinds of organizations that use Maximize Coverage (emergency response, for instance) use Minimize Facilities so that all possible demand points will be covered.

The following list describes how the Minimize Facilities problem handles demand:

  • A demand point that cannot reach any facilities due to a cutoff distance or time is not allocated.
  • A demand point that can only reach one facility has all its demand weight allocated to that facility.
  • A demand point that can reach two or more facilities has all its demand weight allocated to the nearest facility only.

Maximize Attendance

Maximize Attendance problem type

Maximize Attendance chooses facilities such that as much demand weight as possible is allocated to facilities while assuming the demand weight decreases with distance. The demand points, represented by pie charts in this graphic, show how much of their total demand is captured by the facility.

Facilities are chosen such that as much demand weight as possible is allocated to facilities while assuming the demand weight decreases in relation to the distance between the facility and the demand point.

Specialty stores that have little or no competition benefit from this problem type, but it may also be beneficial to general retailers and restaurants that don't have the data on competitors necessary to perform market share problem types. Some businesses that might benefit from this problem type include coffee shops, fitness centers, dental and medical offices, and electronics stores. Public transit bus stops are often chosen with the help of Maximize Attendance. Maximize Attendance assumes that the farther people have to travel to reach your facility, the less likely they are to use it. This is reflected in how the amount of demand allocated to facilities diminishes with distance.

The following list describes how the Maximize Attendance problem handles demand:

  • A demand point that cannot reach any facilities due to a cutoff distance or time is not allocated.
  • When a demand point can reach a facility, its demand weight is only partially allocated to the facility. The amount allocated decreases as a function of the maximum cutoff distance (or time) and the travel distance (or time) between the facility and the demand point.
  • The weight of a demand point that can reach more than one facility is proportionately allocated to the nearest facility only.

Maximize Market Share

Maximize Market Share problem type

Maximize Market Share chooses facilities such that the largest amount of allocated demand is captured in the presence of competitors. You specify the number of facilities you want it to choose.

A specific number of facilities are chosen such that the allocated demand is maximized in the presence of competitors. The goal is to capture as much of the total market share as possible with a given number of facilities, which you specify. The total market share is the sum of all demand weight for valid demand points.

The market share problem types require the most data because, along with knowing your own facilities' weight, you also need to know that of your competitors' facilities. The same types of facilities that use the Maximize Attendance problem type can also use market share problem types, given that they have comprehensive information that includes competitor data. Large discount stores typically use Maximize Market Share to locate a finite set of new stores. The market share problem types use a Huff model, which is also known as a gravity model or spatial interaction.

The following list describes how the Maximize Market Share problem handles demand:

  • A demand point that cannot reach any facilities due to a cutoff distance or time is not allocated.
  • A demand point that can only reach one facility has all its demand weight allocated to that facility.
  • A demand point that can reach two or more facilities has all its demand weight allocated to them; furthermore, the weight is split among the facilities proportionally to the facilities' attractiveness (facility weight) and inversely proportional to the distance between the facility and demand point. Given equal facility weights, this means more demand weight is assigned to near facilities than far facilities.
  • The total market share, which can be used to calculate the captured market share, is the sum of the weight of all valid demand points.

Target Market Share

Target Market Share problem type

Target Market Share works in the presence of competitors and tries to choose the fewest facilities necessary to capture the market share that you specify.

Target Market Share chooses the minimum number of facilities necessary to capture a specific percentage of the total market share in the presence of competitors. The total market share is the sum of all demand weight for valid demand points. You set the percent of the market share you want to reach and let the solver choose the fewest number of facilities necessary to meet that threshold.

The market share problem types require the most data because, along with knowing your own facilities' weight, you also need to know that of your competitors' facilities. The same types of facilities that use the Maximize Attendance problem type can also use market share problem types, given that they have comprehensive information that includes competitor data.

Large discount stores typically use the Target Market Share problem type when they want to know how much expansion would be required to reach a certain level of the market share or see what strategy would be needed just to maintain their current market share, given the introduction of new competing facilities. The results often represent what stores would like to do if budgets weren't a concern. In other cases in which budget is a concern, stores revert to the Maximize Market Share problem and simply capture as much of the market share as possible with a limited number of facilities.

The following list describes how the target market share problem handles demand:

  • The total market share, which is used in calculating the captured market share, is the sum of the weight of all valid demand points.
  • A demand point that cannot reach any facilities due to a cutoff distance or time is not allocated.
  • A demand point that can only reach one facility has all its demand weight allocated to that facility.
  • A demand point that can reach two or more facilities has all its demand weight allocated to them; furthermore, the weight is split among the facilities proportionally to the facilities' attractiveness (facility weight) and inversely proportional to the distance between the facility and demand point. Given equal facility weights, this means more demand weight is assigned to near facilities than far facilities.

number_of_facilities_to_find

Specify the number of facilities the task should choose. The default value is 1.

The facilities with a FacilityType attribute value of 1 (Required) are always chosen first. Any excess facilities to choose are picked from candidate facilities, which have a FacilityType attribute value of 2. If the number of facilities to find is less than the number of required facilities, an error occurs.

The number_of_facilities_to_find parameter is ignored for the Minimize Facilities and Target Market Share problem types since the task determines the minimum number of facilities needed to meet the objectives.

default_measurement_cutoff

Specifies the maximum travel time or distance allowed between a demand point and the facility to which it is allocated. If a demand point is outside the cutoff of a facility, it cannot be allocated to that facility.

The default value is none, which means travel isn't limited. The units for this parameter are the same as those specified by the measurement_units parameter. The travel time or distance is measured by the shortest path along roads. This property might be used to model the maximum distance that people are willing to travel to visit stores or the maximum time that is permitted for a fire department to reach anyone in the community.

Note that demand points have TimeCutoff and DistanceCutoff attributes, which, if set accordingly, override the default_measurement_cutoff parameter. You may find that people in rural areas are willing to travel up to 10 miles to reach a facility while urbanites are only willing to travel up to two miles. Assuming measurement_units is set to miles , you can model this behavior by setting the default_measurement_cutoff to 10 and the DistanceCutoff attribute value of the demand points in urban areas to 2.

default_capacity

This parameter is specific to the Maximize Capacitated Coverage problem type and is ignored for all other problem types. It is the default capacity assigned to all facilities in the analysis. You can override the default capacity for a facility by specifying a value in the facility's Capacity attribute. The default value is 1.

target_market_share

This parameter is specific to the Target Market Share problem type and is ignored for all other problem types. It is the percentage of the total demand weight that you want the chosen and required facilities to capture. The task chooses the minimum number of facilities needed to capture the target market share specified here. The default value is 10 percent.

measurement_transformation_model

This sets the equation for transforming the network cost between facilities and demand points. This parameter, coupled with impedance_parameter , specifies how severely the network impedance between facilities and demand points influences the task's choice of facilities.

In the following list of transformation options, d refers to demand points and f, facilities. "Impedance" refers to the shortest travel distance or time between two locations. So impedance

df

is the shortest path (time or distance) between demand point d and facility f, and cost

df

is the transformed travel time or distance between the facility and demand point. Lambda (λ) denotes the impedance parameter. The measurement_units setting determines whether travel time or distance is analyzed.

Linear

cost

df

= λ * impedance

df

The transformed travel time or distance between the facility and the demand point is the same as the time or distance of the shortest path between the two locations. With this option, the impedance parameter (λ) is always set to one. This is the default.

Power

cost

df

= impedance

df λ

The transformed travel time or distance between the facility and the demand point is equal to the time or distance of the shortest path raised to the power specified by the impedance parameter (λ). Use the Power option with a positive impedance parameter to specify higher weight to nearby facilities.

Exponential

cost

df

= e

(λ * impedance)

The transformed travel time or distance between the facility and the demand point is equal to the mathematical constant e raised to the power specified by the shortest-path network impedance multiplied with the impedance parameter (λ). Use the Exponential option with a positive impedance parameter to specify a very high weight to nearby facilities.

Example of measurement_transformation_model

The next set of graphics and tables use Minimize Impedance to demonstrate the potential effects of using different impedance transformations and parameters.

Sample problem to demonstrate the effects of impedance transformations

A sample problem setup using two-mile edges with demand points on the ends and candidate facilities in the middle of the edges is shown.

The Linear transformation always uses a parameter value of one, so the cost is unchanged, and facility B minimizes that cost.

FacilityTotal cost (linear)Solution facility

A

3+3+5=11

N/A

B

7+1+1=9

Facility B is chosen.

Comparison of costs using a linear transformation

Sample problem to demonstrate the effects of impedance transformations

Facility B has a lower total transformed cost than facility A when a linear transformation is used.

A Power transformation with a parameter of two amplifies longer distances enough that facility A minimizes cost instead.

FacilityTotal cost (power transformation λ = 2)Solution facility

A

32+32+52=43

Facility A is chosen.

B

72+12+12=51

N/A

Comparison of costs using a power transformation with a parameter of 2.0

Sample problem to demonstrate the effects of impedance transformations

Facility A has a lower total transformed cost than facility B when a squared power transformation is used.

An exponential transformation with an impedance parameter of 0.02 favors nearby demand points, so facility B is the solution facility in this case. (The graphic is omitted, since it would look the same as the linear transformation graphic.)

FacilityTotal cost (exponential transformation λ = 0.02)Solution facility

A

e0.02*3+e0.02*3+e0.02*5=3.23

N/A

B

e0.02*7+e0.02*1+e0.02*1=3.19

Facility B is chosen.

Comparison of costs using an exponential transformation with a parameter of 0.02

measurement_transformation_factor

Provides an impedance parameter value (λ) to the equation specified in the impedance_transformation_model parameter. The parameter value is ignored when the impedance transformation is linear. For power and exponential impedance transformations, the value should be nonzero. The default value is 1.

travel_direction

Specify whether to measure travel times or distances from facilities to demand points or from demand points to facilities. The default value is to measure from facilities to demand points.

  • Facility to Demand —Direction of travel is from facilities to demand points.
  • Demand to Facility —Direction of travel is from demand points to facilities.

Travel times and distances may change based on direction of travel. If you're going from point A to point B, you may encounter less traffic or have a shorter path, due to one-way streets and turn restrictions, than if you were traveling in the opposite direction. For instance, going from point A to point B may only take 10 minutes, but going the other direction may take 15 minutes. These differing measurements may affect whether demand points can be assigned to certain facilities because of cutoffs or, in problem types in which demand is apportioned, affect how much demand is captured.

Fire departments commonly measure from facilities to demand points since they are concerned with the time it takes to travel from the fire station to the location of the emergency. A retail store is more concerned with the time it takes shoppers to reach the store; therefore, stores commonly measure from demand points to facilities.

The travel_direction parameter also determines the meaning of any start time that is provided. See the time_of_day parameter for more information.

time_of_day

Specify the time at which travel begins, or departs, from the starting locations.

Specifying a time of day results in more accurate estimations of travel times because the travel times account for the traffic conditions that are applicable for that date and time.

To use traffic in the analysis, choose a time-based unit for impedance and assign a value to time_Of_day .

The time_Of_day value represents the target start time from facilities or demand points, depending on the travel_direction . The time is specified as Unix time (milliseconds since midnight, January 1, 1970).

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.

The service support two kinds of traffic: live and typical.

If the time_Of_day specified is within 4 hours of the current time, live traffic will be used where available. Live traffic retrieves speeds based on phone probe records, sensors, and other data sources and reflects the current travel speeds and predicts speeds for the near future. If the time_Of_day specified is earlier than 4 hours or later than 4 hours from the current time, or the road does not have live traffic, typical traffic speeds will be used. Typical speeds are based on historical traffic patterns. The travel time data is aggregated in 15 minute intervals per day of week based on multiple years worth of data. So a road may have a different travel time at Monday at 8 am, Monday at 8:15 am, or Tuesday at 8 am. Since the variance is just at the day of week and time of day, the travel time is the same on a road for any Monday at 8 am, regardless of the month or year.

If your goal is to model typical travel conditions and avoid large variances from the average due to live traffic, it is recommended to use a date from the past to ensure it doesn't coincide with the 4 hour window from the current time. As an extreme example, you can even use dates from 1990.

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

Typical traffic

To ensure the task uses typical traffic in locations where it is available, choose a time and day of the week; 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., January 4, 1990, and convert to milliseconds (631458180000 ). Although the dates representing days of the week are from 1990, typical traffic is calculated from recent traffic trends—usually over the last two years worth of data.

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 4 hours and references predictive data extending 4 hours into the future. If the time and date you specify for this parameter is outside the 8-hour time window, or the travel time in the analysis continues past the predictive data window, the task falls back to typical traffic speeds.

Examples for time_of_day

Example one: 13:03, January 4, 1990. Typical traffic on Thursdays at 1:03 p.m.

Use dark colors for code blocksCopy
1
"time_Of_day": 631458180000

Example two: 17:00, January 7, 1990. Typical traffic on Sundays at 5:00 p.m.

Use dark colors for code blocksCopy
1
"time_Of_day": 631731600000

Example four: 10:20, March 18, 2015. If the current time is between 6:20 a.m., March 18, 2015, and 2:20 p.m., March 18, 2015, live traffic speeds are referenced in the analysis; otherwise, typical traffic speeds are referenced.

Use dark colors for code blocksCopy
1
"time_Of_day": 1426674000000

time_zone_for_time_Of_Day

Specify the time zone or zones of the time_Of_day parameter. There are two options: Geographically Local and UTC .

The default value is Geographically Local .

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.

Illustration of setting the value to Geographically Local —Setting time_of_day to 9:00 a.m., January 4, 1990 (631443600000 milliseconds); time_zone_for_time_Of_Day to Geographically Local ; and submitting a valid request causes the drive times for points 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.)

Time zone for time of day parameter is set to geographically local

_Input: time_Of_day is 9:00 a.m., January 4, 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.

Illustration of setting the value to time_Of_day —Setting time_Of_day to 9:00 a.m., January 4, 1990 (631443600000 milliseconds) and the value to UTC , the start times 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.

Time zone for time of day parameter is set to UTC

_Input: time_Of_day is 9:00 a.m., January 4, 1990 (631443600000 milliseconds), and time_zone_for_time_Of_day is set to UTC _

uturn_at_junctions

Use this parameter to restrict or permit the route from making U-turns at junctions.

To understand the available parameter values, 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. This parameter can have the following values:

Parameter ValueDescription

Allowed

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

U-turns permitted

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 permitted 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 intersections and are permitted only at dead ends.

U-turns permitted 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. Even when this parameter value is chosen, a route can still make U-turns at stops. 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 only at Intersections and Dead Ends .

point_barriers

Use this parameter to specify one or more points that will 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 a time delay spent at a railroad crossing.

You can specify barrier geometries as well as attributes using a more comprehensive JSON structure that references a set of features. The property is optional; however, the JSON structure must specify either the url or features property:

  • url —Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set.

  • features —Specify an array of features.

    Each feature in this array represents a point barrier and contains the following fields:

    • geometry —Specify the input point geometry containing x and y properties along with the spatialReference property. If the spatialReference property is defined for the entire JSON, you don't need to define this property for each geometry. Doing so reduces the size of the input JSON if the input has many features and improves performance. This property is not required if the coordinates are in the default spatial reference, WGS84. If the coordinates are in a different spatial reference, you must specify the spatial reference's well-known ID (WKID). See Using spatial references to look up WKID values.

    • attributes —Specify each attribute as a key-value pair in which 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 point barriers, you can set properties for each, such as its name or barrier type, using 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 (use the numeric code, not the name in parentheses):

  • 0 (Restriction)—Prohibits travel through the barrier. The barrier is referred to as a restriction point barrier since it acts as a restriction.

    Two maps demonstrate how a restriction point barrier affects a route analysis.

    The first map shows the shortest path between two stops without any restriction point barriers. The second map has a road that is blocked by a fallen tree, so the shortest path between the same points is longer.

  • 2 (Added Cost)—Traveling through the barrier increases the travel time or distance by the amount specified in the Additional_[Cost] attributes. This barrier type is referred to as an added cost point barrier.

    Two maps demonstrate how added cost point barriers affect a route analysis.

    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.

Additional_Time

The added travel time when the barrier is traversed. This field is applicable only for added-cost barriers and when the measurement_units parameter is time-based

This field value must be greater than or equal to zero, and its units are the same as those specified in the measurement_units parameter.

Additional_Distance

The added distance when the barrier is traversed. This field is applicable only for added-cost barriers and when the measurement_units parameter is distance-based

The field value must be greater than or equal to zero, and its units are the same as those specified in the measurement_units parameter.

AdditionalCost

The added cost when the barrier is traversed. This field is applicable only for added-cost barriers when the impedance attribute is neither time-based nor distance-based.

FullEdge

Specifies how the restriction point barriers are applied to the edge elements during the analysis. The field value is specified as one of the following integers (use the numeric code, not the name in parentheses):

  • 0 (False)—Permits travel on the edge up to the barrier but not through it. This is the default value.
  • 1 (True)—Restricts travel anywhere on the associated edge.

CurbApproach

Specifies the direction of traffic that is affected by the barrier. The field value is specified as one of the following integers (use the numeric code, not the name in parentheses):

  • 0 (Either side of vehicle)—The barrier affects travel over the edge in both directions.
  • 1 (Right side of vehicle)—Vehicles are only affected if the barrier is on their right side during the approach. Vehicles that traverse the same edge but approach the barrier on their left side are not affected by the barrier.
  • 2 (Left side of vehicle)—Vehicles are only affected if the barrier is on their left side during the approach. Vehicles that traverse the same edge but approach the barrier on their right side are not affected by the barrier.

Because junctions are points and don't have a side, barriers on junctions affect all vehicles regardless of the curb approach.

The CurbApproach attribute works with both types of national driving standards: right-hand traffic (United States) and left-hand traffic (United Kingdom). First, consider a facility on the left side of a vehicle. It is always on the left side regardless of whether the vehicle travels on the left or right half of the road. What may change with national driving standards is your decision to approach a facility from one of two directions, that is, so it ends up on the right or left side of the vehicle. For example, to arrive at a facility and not have a lane of traffic between the vehicle and the facility, choose 1 (Right side of vehicle) in the United States and 2 (Left side of vehicle) in the United Kingdom.

Bearing

The direction in which a point is moving. The units are degrees and are measured clockwise from true north. This field is used in conjunction with the BearingTol field.

Bearing data is usually sent automatically from a mobile device equipped with a GPS receiver. Try to include bearing data if you are loading an input location that is moving, such as a pedestrian or a vehicle.

Using this field tends to prevent adding locations to the wrong edges, which can occur when a vehicle is near an intersection or an overpass, for example. Bearing also helps the tool determine on which side of the street the point is.

Learn more about bearing and bearing tolerance

BearingTol

The bearing tolerance value creates a range of acceptable bearing values when locating moving points on an edge using the Bearing field. If the Bearing field value is within the range of acceptable values that are generated from the bearing tolerance on an edge, the point can be added as a network location there; otherwise, the closest point on the next-nearest edge is evaluated.

The units are in degrees, and the default value is 30. Values must be greater than 0 and less than 180. A value of 30 means that when Network Analyst attempts to add a network location on an edge, a range of acceptable bearing values is generated 15 degrees to either side of the edge (left and right) and in both digitized directions of the edge.

Learn more about bearing and bearing tolerance

NavLatency

This field is only used in the solve process if the Bearing and BearingTol fields also have values; however, entering a NavLatency field value is optional, even when values are present in Bearing and BearingTol . NavLatency indicates how much cost is expected to elapse from the moment GPS information is sent from a moving vehicle to a server and the moment the processed route is received by the vehicle's navigation device.

The units of NavLatency are the same as the units of the impedance attribute.

Syntax examples for point_barriers

Syntax for specifying point_barriers using a JSON structure for features

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "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

Use dark colors for code blocksCopy
1
2
3
{
  "url": "<url>"
}

Examples for point_barriers

Example 1: Specifying an added-cost point barrier using JSON structure

This example shows how to use an added-cost point barrier to model a five-minute delay at a railroad crossing. The BarrierType attribute is used to specify the point barrier is added-cost, and the Additional_Time attribute is used to specify the added delay in minutes.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "spatialReference": {
    "wkid": 4326
  },
  "features": [
    {
      "geometry": {
        "x": 37.541479,
        "y": -122.053461
      },
      "attributes": {
        "Name": "Haley St railroad crossing",
        "BarrierType": 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's blocked by a fallen tree. The barrier's geometry is in the Web Mercator spatial reference and not in the spatial reference of the network dataset.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "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.

Use dark colors for code blocksCopy
1
2
3
{
  "url": "https://machine.domain.com/webadaptor/rest/services/NetworkAnalysis/SanDiego/MapServer/21/query?where=1%3D1&outFields=Name&f=json"
}
Use dark colors for code blocksCopy
1
2
3
{
    "url": "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/0/query?where=1%3D1&returnGeometry=true&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 first map displays the shortest path between two stops. The second map shows the shortest path when several streets are blocked by a polyline barrier.

You can specify polyline barrier geometries as well as attributes using a JSON structure that references a set of features. The property is optional; however, the JSON structure must specify either the url or features property:

  • url —Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set.

  • features —Specify an array of features.

    Each feature in this array represents a polyline barrier and contains the following fields:

    • geometry —Specify the input point geometry containing x and y properties along with the spatialReference property. If the spatialReference property is defined for the entire JSON, you don't need to define this property for each geometry. Doing so reduces the size of the input JSON if the input has many features and improves performance. This property is not required if the coordinates are in the default spatial reference, WGS84. If the coordinates are in a different spatial reference, you must specify the spatial reference's well-known ID (WKID). See Using spatial references to look up WKID values.

    • attributes —Specify each attribute as a key-value pair in which the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for line_barriers

When specifying the line barriers, you can set name and barrier type properties for each using the following attributes:

  • Name

    The name of the barrier.

Syntax examples for line_barriers

Syntax for specifying line barriers using a JSON structure for features

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
  "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

Use dark colors for code blocksCopy
1
2
3
{
  "url": "<url>"
}

Examples for line_barriers

Example 1: Specifying line barriers using a JSON structure

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.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  "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.

Use dark colors for code blocksCopy
1
2
3
{
  "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.

You can specify polygon barrier geometries as well as attributes using a JSON structure that references a set of features. The property is optional; however, the JSON structure must specify either the url or features property:

  • url —Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set.

  • features —Specify an array of features.

    Each feature in this array represents a polygon barrier and contains the following fields:

    • geometry —Specify the input point geometry containing x and y properties along with the spatialReference property. If the spatialReference property is defined for the entire JSON, you don't need to define this property for each geometry. Doing so reduces the size of the input JSON if the input has many features and improves performance. This property is not required if the coordinates are in the default spatial reference, WGS84. If the coordinates are in a different spatial reference, you must specify the spatial reference's well-known ID (WKID). See Using spatial references to look up WKID values.

    • attributes —Specify each attribute as a key-value pair in which 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 polygon barriers, you can set properties for each, such as its name or barrier type, using the following attributes:

  • Name

    The name of the barrier.

  • BarrierType

    Specifies whether the barrier restricts travel completely or scales the cost (such as time or distance) for traveling through it. The field value is specified as one of the following integers (use the numeric code, not the name in parentheses):

    • 0 (Restriction)—Prohibits traveling through any part of the barrier. The barrier is referred to as a restriction polygon barrier since it prohibits traveling on streets intersected by the barrier. One use of this type of barrier is to model floods covering areas of the street that make traveling on those streets impossible.

      This is the default value.

      Two maps demonstrate how a restriction polygon barrier affects finding a route between two stops.

      The first map depicts the shortest path between two stops. The second map shows a polygon barrier blocking flooded streets, so the shortest path between the same two stops is different.

    • 1 (Scaled Cost)—Scales the cost (such as travel time or distance) required to travel the underlying streets by a factor specified using the ScaledTimeFactor or ScaledDistanceFactor field. If the streets are partially covered by the barrier, the travel time or distance is apportioned and then scaled. For example, a factor of 0.25 means that travel on underlying streets is expected to be four times faster than normal. A factor of 3.0 means it is expected to take three times longer than normal to travel on underlying streets. This barrier type is referred to as a scaled-cost polygon barrier. It can be used to model storms that reduce travel speeds in specific regions, for example.

      Two maps demonstrate how a scaled cost polygon barrier affects finding a route between two stops.

      The first map shows a route that goes through inclement weather without regard for the effect that poor road conditions have on travel time. The second map shows a scaled polygon barrier that doubles the travel time of the roads covered by the storm. 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, and 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. The field value must be greater than zero.

    This field is applicable only for scaled-cost barriers and when the measurement_units parameter is time-based.

  • ScaledDistanceFactor

    This is the factor by which the distance of the streets intersected by the barrier is multiplied. The field value must be greater than zero.

    This field is applicable only for scaled-cost barriers and when the measurement_units parameter is distance-based.

  • ScaledCostFactor

    This is the factor by which the cost of the streets intersected by the barrier is multiplied. The field value must be greater than zero.

    This field is applicable only for scaled-cost barriers when the impedance is neither time-based nor distance-based .

Syntax examples for polygon_barriers

Syntax for specifying polygon barriers using a JSON structure for features

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  "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

Use dark colors for code blocksCopy
1
2
3
{
  "url": "<url>"
}

Examples for polygon_barriers

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.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  "spatialReference": {
    "wkid": 4326
  },
  "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.

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

use_hierarchy

Specify whether hierarchy will be used when finding the shortest paths.

  • true —Use hierarchy when travelling between stops. When hierarchy is used, the service prefers higher-order streets (such as freeways) to lower-order streets (such as local roads) and can be used to simulate the driver preference of traveling on freeways instead of local roads even if that means a longer trip. This is especially true when finding routes to faraway locations, because drivers on long-distance trips tend to prefer traveling on freeways where stops, intersections, and turns can be avoided. Using hierarchy is computationally faster, especially for long-distance routes, since the service can determine the best route from a relatively smaller subset of streets.
  • false —Do not use hierarchy when travelling between stops. When hierarchy is not used, the service considers all the streets and doesn't prefer higher-order streets when finding the route. This is often used when finding short-distance routes within a city.

The default value for this parameter is true .

restrictions

Use this parameter to specify the restrictions that will 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 the Avoid Toll Roads restriction will result in a route that will include toll roads only when it is required to travel on toll roads to visit a stop. Use Height Restriction to route around clearances that are lower than the height of the vehicle. If the vehicle is carrying corrosive materials, you can use the Any Hazmat Prohibited restriction to prevent hauling the materials along roads where it is marked as illegal to do so.

This parameter value is specified as a comma-separated list of restriction names. A value of none indicates that no restrictions will be used when finding the shortest paths.

The service supports the following restriction names:

  • Any Hazmat Prohibited—The results will not include roads where transporting any kind of hazardous material is prohibited.
  • Avoid Carpool Roads—The results will avoid roads that are designated exclusively for car pool (high-occupancy) vehicles.
  • Avoid Express Lanes—The results will avoid roads designated as express lanes.
  • Avoid Ferries—The results will avoid ferries.
  • Avoid Gates—The results will avoid roads where there are gates, such as keyed access or guard-controlled entryways.
  • Avoid Limited Access Roads—The results will avoid roads that are limited-access highways.
  • Avoid Private Roads—The results will avoid roads that are not publicly owned and maintained.
  • Avoid Roads Unsuitable for Pedestrians—The results will avoid roads that are unsuitable for pedestrians.
  • Avoid Stairways—The results will avoid all stairways on a pedestrian-suitable route.
  • Avoid Toll Roads—The results will avoid all toll roads for automobiles.
  • Avoid Toll Roads for Trucks—The results will avoid all toll roads for trucks.
  • Avoid Truck Restricted Roads—The results will avoid roads where trucks are not allowed, except when making deliveries.
  • Avoid Unpaved Roads—The results will avoid roads that are not paved (for example, dirt, gravel, and so on).
  • Axle Count Restriction—The results 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.
  • Driving a Bus—The results will not include roads where buses are prohibited. Using this restriction will also ensure that the results will honor one-way streets.
  • Driving a Taxi—The results will not include roads where taxis are prohibited. Using this restriction will also ensure that the results will honor one-way streets.
  • Driving a Truck—The results will not include roads where trucks are prohibited. Using this restriction will also ensure that the results will honor one-way streets.
  • Driving an Automobile—The results will not include roads where automobiles are prohibited. Using this restriction will also ensure that the results will honor one-way streets.
  • Driving an Emergency Vehicle—The results will not include roads where emergency vehicles are prohibited. Using this restriction will also ensure that the results will honor one-way streets.
  • Height Restriction—The results will not include 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.
  • Kingpin to Rear Axle Length Restriction—The results will not include roads where the vehicle length exceeds the maximum allowed kingpin to rear axle for all trucks on the road. The length between the vehicle kingpin and the rear axle can be specified using the Vehicle Kingpin to Rear Axle Length (meters) restriction parameter.
  • Length Restriction—The results will not include 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.
  • Preferred for Pedestrians—The results will use preferred routes suitable for pedestrian navigation.
  • Riding a Motorcycle—The results will not include roads where motorcycles are prohibited. Using this restriction will also ensure that the results will honor one-way streets.
  • Roads Under Construction Prohibited—The results will not include roads that are under construction.
  • Semi or Tractor with One or More Trailers Prohibited—The results will not include roads where semis or tractors with one or more trailers are prohibited.
  • Single Axle Vehicles Prohibited—The results will not include roads where vehicles with single axles are prohibited.
  • Tandem Axle Vehicles Prohibited—The results will not include roads where vehicles with tandem axles are prohibited.
  • Through Traffic Prohibited—The results will not include roads where through traffic (nonlocal traffic) is prohibited.
  • Truck with Trailers Restriction—The results will not include 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.
  • Use Preferred Hazmat Routes—The results will prefer roads that are designated for transporting hazardous materials.
  • Use Preferred Truck Routes—The results will prefer roads that are designated as truck routes, such as 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 roads that are preferred by truckers when driving in an area.
  • Walking—The results will not include roads where pedestrians are prohibited.
  • Weight Restriction—The results will not include 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.
  • Weight per Axle Restriction—The results will not include roads where the vehicle weight per axle exceeds the maximum allowed weight per axle for the road. The vehicle weight per axle can be specified using the Vehicle Weight per Axle (kilograms) restriction parameter.
  • Width Restriction—The results will not include roads where the vehicle width exceeds the maximum allowed width for the road. The vehicle width can be specified using the Vehicle Width (meters) restriction parameter.

The restrictions parameter value is specified as a list of restriction names. 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 for restrictions

Use dark colors for code blocksCopy
1
restrictions=[Driving a Truck, 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. For example, you can choose to never use toll roads, avoid them as much as possible, or prefer them.

You can specify attribute_parameter_values parameter using JSON structure that represents a set of features. The JSON structure can include the following properties:

  • features —Specify an array of features.

    • geometry —Specify the input point geometry containing x and y properties along with the spatialReference property. If the spatialReference property is defined for the entire JSON, you don't need to define this property for each geometry. Doing so reduces the size of the input JSON if the input has many features and improves performance. This property is not required if the coordinates are in the default spatial reference, WGS84. If the coordinates are in a different spatial reference, you must specify the spatial reference's well-known ID (WKID). See Using spatial references to look up WKID values.

    • attributes —Specify each attribute as a key-value pair in which the key is the name of a given field, and the value is the attribute value for the corresponding field.

  • url —Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set.

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

  • attributes —Specify each attribute as a key-value pair in which the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for attribute_parameter_values

The attribute_parameter_values parameter can be specified with the following attributes:

  • AttributeName —The name of the restriction.
  • ParameterName —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.

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 that have the restriction is prohibited.
  • Avoid_High (5 )—It is very unlikely the service will include in the route the roads that are associated with the restriction.
  • Avoid_Medium (2 )—It is unlikely the service will include in the route the roads that are associated with the restriction.
  • Avoid_Low (1.3 )—It is somewhat unlikely the service will include in the route the roads that are associated with the restriction.
  • Prefer_Low (0.8 )—It is somewhat likely the service will include in the route the roads that are associated with the restriction.
  • Prefer_Medium (0.5 )—It is likely the service will include in the route the roads that are associated with the restriction.
  • Prefer_High (0.2 )—It is very likely the service will include in the route the roads that are 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 below table.

Restriction nameRestriction parameter nameRestriction parameter default value

Any Hazmat Prohibited

Restriction Usage

Prohibited

Avoid Carpool Roads

Restriction Usage

Prohibited

Avoid Express Lanes

Restriction Usage

Prohibited

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 Roads Unsuitable for Pedestrians

Restriction Usage

Avoid_High

Avoid Stairways

Restriction Usage

Avoid_High

Avoid Toll Roads

Restriction Usage

Avoid_Medium

Avoid Toll Roads for Trucks

Restriction Usage

Avoid_Medium

Avoid Truck Restricted Roads

Restriction Usage

Avoid_High

Avoid Unpaved Roads

Restriction Usage

Avoid_High

Axle Count Restriction

Number of Axles

0

Restriction Usage

Prohibited

Driving a Bus

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

Preferred for Pedestrians

Restriction Usage

Prefer_Low

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 example for attribute_parameter_values

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
    "features": [
        {
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>,
                "<field3>": <value13>

            }
        },
        {
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>,
                "<field3>": <value13>
            }
        }
    ]
}

Examples for attribute_parameter_values

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.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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.

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 typical 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:

  • TravelTime—Historical and live traffic data is used. This option is good for modeling the time it takes automobiles to travel along roads at a specific time of day using live traffic speed data where available. When using TravelTime, you can optionally set the TravelTime::Vehicle Maximum Speed (km/h) attribute parameter to specify the physical limitation of the speed the vehicle is capable of traveling.
  • Minutes—Live traffic data is not used, but historical average speeds for automobiles data is used.
  • TruckTravelTime—Historical and live traffic data is used, but the speed is capped at the posted truck speed limit. This is good for modeling the time it takes for the trucks to travel along roads at a specific time. When using TruckTravelTime, you can optionally set the TruckTravelTime::Vehicle Maximum Speed (km/h) attribute parameter to specify the physical limitation of the speed the truck is capable of traveling.
  • TruckMinutes—Live traffic data is not used, but the smaller of the historical average speeds for automobiles and the posted speed limits for trucks are used.
  • WalkTime—The default is a speed of 5 km/hr on all roads and paths, but this can be configured through the WalkTime::Walking Speed (km/h) attribute parameter.
  • Miles—Length measurements along roads are stored in miles and can be used for performing analysis based on shortest distance.
  • Kilometers—Length measurements along roads are stored in kilometers and can be used for performing analysis based on shortest distance.

If you choose a time-based impedance, such as TravelTime , TruckTravelTime , Minutes , TruckMinutes , or WalkTime , the measurement_units parameter must be set to a time-based value; if you choose a distance-based impedance such as Miles , Kilometers , the measurement_units must be distance-based.

allocation_line_shape

Specify the type of line features that are output by the tool. The parameter accepts the following values:

  • Straight Line —Straight lines between solution facilities and the demand points allocated to them are returned. Drawing straight lines on a map helps you visualize how demand is allocated.
  • None —A table containing data about the shortest paths between solution facilities and the demand points allocated to them is returned; lines are not returned.

The default value is Straight Line .

Regardless of the value you choose for the allocation_line_shape parameter, the shortest route is determined by minimizing the travel time or the travel distance, not using the straight-line distance between incidents and facilities. That is, this parameter only changes the output line shapes; it doesn't change the measurement method.

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

The default value is false .

overrides

time_impedance

The time-based impedance value represents the travel time along road segments or on other parts of the transportation network.

  • Minutes
  • TravelTime
  • WalkTime
  • TruckMinutes
  • TruckTravelTime

distance_impedance

The distance-based impedance value represents the travel distance along road segments or on other parts of the transportation network.

  • Miles
  • Kilometers

output_format

Specifies the format in which the output features will be returned.

  • Feature Set—The output features will be returned as feature classes and tables. This is the default.
  • JSON File—The output features will be returned as a compressed file containing the JSON representation of the outputs. When this option is specified, the output is a single file (with a .zip extension) that contains one or more JSON files (with a .json extension) for each of the outputs created by the service.
  • GeoJSON File—The output features will be returned as a compressed file containing the GeoJSON representation of the outputs. When this option is specified, the output is a single file (with a .zip extension) that contains one or more GeoJSON files (with a .geojson extension) for each of the outputs created by the service.

env:outSR

Use this parameter to specify the spatial reference of the geometries, such as line or point features, returned by the service.

The parameter value can be specified as a well-known ID (WKID) for the spatial reference. See Using spatial references 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.

ignore_invalid_locations

Specifies whether invalid input locations will be ignored.

  • true

    Network locations that are unlocated will be ignored and the analysis will run using valid network locations only. The analysis will also continue if locations are on nontraversable elements or have other errors. This is useful if you know the network locations are not all correct, but you want to run the analysis with the network locations that are valid. This is the default.

  • false

    Invalid locations will not be ignored. Do not run the analysis if there are invalid locations. Correct the invalid locations and rerun the analysis.

locate_settings

Use this parameter to specify settings that affect how inputs are located, such as the maximum search distance to use when locating the inputs on the network or the network sources being used for locating.

Learn more about locating inputs

The default value is as follows:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
{
  "default": {
    "tolerance": 20000,
    "toleranceUnits": "esriMeters",
    "allowAutoRelocate": true,
    "sources": [
      {
        "name": "main.Routing_Streets"
      }
    ]
  }
}

The locator JSON object has following properties:

  • tolerance and toleranceUnits —Allows you to control the maximum search distance when locating inputs. If no valid network location is found within this distance, the input features will be considered unlocated. A small search tolerance decreases the likelihood of locating on the wrong street but increases the likelihood of not finding any valid network location. The toleranceUnits parameter value can be specified as one of the following values:

    • esriCentimeters
    • esriDecimalDegrees
    • esriDecimeters
    • esriFeet
    • esriInches
    • esriIntFeet
    • esriIntInches
    • esriIntMiles
    • esriIntNauticalMiles
    • esriIntYards
    • esriKilometers
    • esriMeters
    • esriMiles
    • esriMillimeters
    • esriNauticalMiles
    • esriYards
  • sources — Allows you to control which network source can be used for locating. For example, you can configure the analysis to locate inputs on streets but not on sidewalks. The list of possible sources on which to locate is specific to the network dataset this service references. Only the sources that are present in the sources array are used for locating. Sources is specified as an array of objects each having the following property:

    • name —The name of the network source feature class that can be used for locating inputs
  • allowAutoRelocate —Allows you to control whether inputs with existing network location fields can be automatically relocated when solving to ensure valid, routable location fields for the analysis. If the value is true , points located on restricted network elements and points affected by barriers will be relocated to the closest routable location. If the value is false , network location fields will be used as is even if the points are unreachable, and this may cause the solve to fail. Even if the value is false , inputs with no location fields or incomplete location fields will be located during the solve operation.

The parameter value is specified as a JSON object. The JSON object allows you to specify a locator JSON for all input feature in the analysis, or you can specify an override for a particular input. The override allows you to have different settings for each analysis input. When specifying the locateSettings JSON, you must provide all the properties including tolerance , toleranceUnits , sources , and allowAutoRelocate in the default locator JSON object. If you need to provide a different locator JSON for a particular input class, you must include the overrides property for that input. The property name must match the input parameter name. The locator JSON for a particular input doesn't need to include all the properties; you only need to include the properties that are different from the default locator JSON properties.

Syntax for locate_settings

Syntax for specifying locate_settings using JSON structure.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
    "default": {
        "tolerance": <value>,
        "toleranceUnits": "<unit>",
        "allowAutoRelocate": true | false,
        "sources": [{
            "name": "<sourceName>"
        }]
    },
    "overrides": {
        "facilities": {
            "tolerance": <value>,
            "toleranceUnits": "<unit>",
            "allowAutoRelocate": true | false,
            "sources": [{
                "name": "<sourceName>"
            }]
        },
        "demand_points": {
            "tolerance": <value>,
            "toleranceUnits": "<unit>",
            "allowAutoRelocate": true | false,
            "sources": [{
                "name": "<sourceName>"
            }]
        },
        "point_barriers": {
            "tolerance": <value>,
            "toleranceUnits": "<unit>",
            "allowAutoRelocate": true | false,
            "sources": [{
                "name": "<sourceName>"
            }]
        },
        "line_barriers": {
            "allowAutoRelocate": true | false,
            "sources": [{
                "name": "<sourceName>"
            }]
        },
        "polygon_barriers": {
            "allowAutoRelocate": true | false,
            "sources": [{
                "name": "<sourceName>"
            }]
        }
    }
}

Example for locate_settings

Example 1: Specify default locate settings using JSON structure

This example shows how to specify locate settings so inputs are located within 500 meters of the specified location. A small search tolerance like this can be valuable if you are solving using a walking travel mode and don't want inputs to be located farther than 500 meters from the original point location.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
{
  "default": {
    "tolerance": 500,
    "toleranceUnits": "esriMeters",
    "allowAutoRelocate": true,
    "sources": [
      {
        "name": "main.Routing_Streets"
      }
    ]
  }
}

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.

Use dark colors for code blocksCopy
1
2
3
4
{
    "jobId": <jobID>,
    "jobStatus": <jobStatus>
}

The jobStatus property can have the following values:

  • esriJobSubmitted
  • esriJobWaiting
  • esriJobExecuting
  • esriJobSucceeded
  • esriJobFailed
  • esriJobTimedOut
  • esriJobCancelling
  • esriJobCancelled

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 retrieve 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:

https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<yourJobID>?token=<yourToken>&returnMessages=true&f=json

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
    "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:

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

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 at a later time. 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 retrieved the results or ignored them. Therefore, your application should always cancel the request if required.

After the successful completion of the job, you can retrieve a specific output by making a request of the following form:

https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<yourJobID>/results/<output_parameter_name>?token=<yourToken>&f=json

Instead of retrieving outputs individually, you can make a request of the following form to retrieve all the outputs.

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

Refer to the Output parameters section for more information on how to interpret the solution provided by the service.

The feature geometries are returned by default in the WGS84 spatial reference. You can get the feature geometries in any spatial reference by specifying the outSR parameter when retrieving an output parameter or all the output parameters.

The below example shows how to retrieve an output parameter with feature geometries in Web Mercator (WKID: 102100) spatial reference.

https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<yourJobID>/results/<output_parameter_name>?token=<yourToken>&f=json&outSR=102100

The below example shows how to retrieve all the output parameters with feature geometries in Web Mercator (WKID: 102100) spatial reference.

https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<yourJobID>/results?token=<yourToken>&f=json&outSR=102100

The below example shows how to retrieve the value for an input parameter by making the requests of the following form:

https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<yourJobID>/inputs/<inputParameterName>?token=<yourToken>&f=json

The below example shows how to retrieve all the inputs by making the request of the following form.

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

Output parameters

After successfully executing, the service returns the chosen facilities, participating demand points, connecting lines between demand points and the facilities they were assigned to, and the status of whether the analysis was successful. This information is output in the following output parameters:

output_facilities

This provides access to the chosen, required, and competitor facilities, as well as any candidate facilities that were not chosen.

This parameter supports the following fields. In addition to these fields, the parameter also includes all the fields from the input facilities used for the analysis.

FieldDescription

Name

The name of the facility. The values for this field are copied from the Name field on the input facilities.

FacilityOID

The ObjectID value of the corresponding input facility feature. This field is often used to join information from the input facilities.

FacilityType

The best facilities, or those that are chosen in the analysis, are indicated in this field. The facility types are as follows:

  • 0 (Candidate)—The service didn't choose the candidate facility to be part of the solution.
  • 1 (Required)—Prior to submitting the analysis, the facility was designated as required; therefore, it is part of the solution regardless of how much demand it captured.
  • 2 (Competitor)—The facility represents the rivals and will remove demand from the problem. Competitor facilities are specific to the Maximize Market Share and Target Market Share problem types; they are ignored in other problem types.
  • 3 (Chosen)—These are the chosen facilities; that is, they are candidate facilities that capture the most demand.

Weight

The relative weighting of the facility, which is used to rate the attractiveness, desirability, or bias of one facility compared to another. The values for this field are copied from the Weight field on the input facilities.

Capacity

The amount of weighted demand the facility is capable of supplying. The values for this field are copied from the Capacity field on the input facilities.

DemandCount

A count of demand points allocated to the facility. A value other than zero means the facility was part of the solution, either as a required, competitor, or chosen facility.

DemandWeight

The sum of the effective weight from all demand points that were allocated to the facility. The value is the sum of all the weight values from the demand points that were allocated to the facility. In the case of the Maximize Attendance and Market Share problem types, the value is an apportioned sum of the Weight field values, since these problem types allow demand to decay with distance or be split among many facilities.

Total_Minutes

The sum of travel time in minutes between the facility and each of the demand points that were allocated to the facility.

This field is included only if the travel mode set for the analysis has an impedance attribute that is time based.

TotalWeighted_Minutes

This field stores the cumulative weighted cost in minutes for a facility. The weighted cost for a demand point is its weight multiplied by the least-cost path between the facility and the demand point. The weighted cost for a facility is the sum of all the weighted costs of demand points that are allocated to the facility.

For example, if a demand point with a weight of 2 is allocated to a facility 10 minutes away, the TotalWeighted_Minutes value is 20 (2 x 10). If another demand point with a weight of 3 is allocated to the same facility and is 5 minutes away, the TotalWeighted_Minutes value increases to 35 (3 x 5 + 20).

This field is included only if the travel mode set for the analysis has an impedance attribute that is time based.

Total_Miles

The sum of travel distance in miles between the facility and each of the demand points that were allocated to the facility.

This field is included only if the travel mode set for the analysis has an impedance attribute that is distance based.

TotalWeighted_Miles

This field stores the cumulative weighted cost in miles for a facility. The weighted cost for a demand point is its weight multiplied by the least-cost path between the facility and the demand point. The weighted cost for a facility is the sum of all the weighted costs of demand points that are allocated to the facility.

For example, if a demand point with a weight of 2 is allocated to a facility 10 miles away, the TotalWeighted_Miles value is 20 (2 x 10). If another demand point with a weight of 3 is allocated to the same facility and is 5 miles away, the TotalWeighted_Miles value increases to 35 (3 x 5 + 20)

This field is included only if the travel mode set for the analysis has an impedance attribute that is distance based.

Total_Kilometers

This field is analogous to the Total_Miles field, except values are in kilometers instead of miles.

TotalWeighted_Kilometers

This field is analogous to the TotalWeighted_Miles field, except values are in kilometers instead of miles.

Total_Other

A sum of travel cost in unknown units between the facility and each of the demand points that were allocated to the facility.

This field is included only if the travel mode set for the analysis has an impedance attribute that is neither time based nor distance based.

TotalWeighted_Other

This field stores the cumulative weighted cost in unknown units for a facility. The weighted cost for a demand point is its weight multiplied by the least-cost path between the facility and the demand point. The weighted cost for a facility is the sum of all the weighted costs of demand points that are allocated to the facility.

This field is included only if the travel mode set for the analysis has an impedance attribute that is neither time based nor distance based.

SourceID

The numeric identifier of the network dataset source feature class on which the input point is located.

SourceOID

The ObjectID of the feature in the source on which the input point is located.

PosAlong

The position along the digitized direction of the source line feature. This value is stored as a ratio. This field is null if the network location references a junction.

SideOfEdge

The side of the edge in relation to the digitized direction of the line feature. This field is limited to a domain of two values: Right Side (1) and Left Side (2).

CurbApproach

The direction a vehicle may depart from or arrive at the facility. The values for this field are copied from the CurbApproach field on the input facilities.

Status

Indicates the status of the point with respect to its location on the network and the outcome of the analysis. The possible values are the following:

  • 0 (OK)—The point was located on the network.
  • 1 (Not Located)—The point was not located on the network and consequently was not included in the analysis.
  • 2 (Network element not located)—The network element identified by the point's network location fields can't be found. This can occur when a network element where the point should be was deleted, and the network location was not recalculated.
  • 3 (Element not traversable)—The network element that the point is located on is not traversable. This can occur when the element is restricted by a restriction attribute.
  • 4 (Invalid Field Values)—Field values fall outside a range or coded-value domain. For example, a negative number exists where positive numbers are required.
  • 5 (Not Reached)—The point can't be reached by the solver. The point may be on a separate, disconnected area of the network from the other inputs, or barriers or restrictions prevent travel to or from the point.
  • 6 (Time window violation)—The point could not be reached within the designated time windows. This status only applies to network analysis types that support time windows.
  • 7 (Not located on closest)—The closest network location to the point is not traversable because of a restriction or barrier, so the point has been located on the closest traversable network feature instead.

SnapX

The x-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset.

SnapY

The y-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset.

SnapZ

The z-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset. The SnapZ field is 0 if the network is two dimensional.

DistanceToNetworkInMeters

The distance in meters between the point's geographic location and the position where it was located on the network.

Bearing

The values for this field are copied from the Bearing field on the input facilities.

BearingTol

The values for this field are copied from the BearingTol field on the input facilities.

NavLatency

The values for this field are copied from the NavLatency field on the input facilities.

output_demand_points

This provides access to the demand points that participated in the analysis: those that were and were not allocated to facilities.

This parameter supports the following fields. In addition to these fields, the parameter also includes all the fields from the input feature class used as facilities for the analysis.

FieldDescription

Name

The name of the demand point. The values for this field are copied from the Name field on the input demand points.

FacilityOID

The ObjectID value of the facility to which this demand point is allocated. The field value is Null if the demand point is not allocated to any facility. This field is often used to join information from the input facilities to the output demand points.

DemandOID

The ObjectID value of the corresponding input demand point feature. This field is often used to join information.

Weight

The relative weighting of the demand point. The values for this field are copied from the Weight field on the input demand points.

AllocatedWeight

The amount of demand allocated to chosen and required facilities. The value excludes demand allocated to competing facilities. The value options are as follows:

  • Null—The demand point wasn't assigned to any facility. This can result, for example, if the demand point could not be reached from any facility.
  • 0—The demand point was only assigned to competing facilities.
  • Positive, nonzero value—Indicates how much demand is assigned to the chosen and required facilities.

GroupName

The name of the group of which the demand point is a part. The values for this field are copied from the GroupName field on the input demand points.

ImpedanceTransformation

The values for this field are copied from the ImpedanceTransformation field on the input demand points.

ImpedancParameter

The values for this field are copied from the ImpedanceParameter field on the input demand points.

Cutoff

The demand point can't be allocated to a facility that is beyond the value indicated here. The values for this field are copied from the Cutoff field on the input demand points.

SourceID

The numeric identifier of the network dataset source feature class on which the input point is located.

SourceOID

The ObjectID of the feature in the source on which the input point is located.

PosAlong

The position along the digitized direction of the source line feature. This value is stored as a ratio. This field is null if the network location references a junction.

SideOfEdge

The side of the edge in relation to the digitized direction of the line feature. This field is limited to a domain of two values: Right Side (1) and Left Side (2).

CurbApproach

The direction a vehicle may depart from or arrive at the demand point. The values for this field are copied from the CurbApproach field on the input facilities.

Status

Indicates the status of the point with respect to its location on the network and the outcome of the analysis. The possible values are the following:

  • 0 (OK)—The point was located on the network.
  • 1 (Not Located)—The point was not located on the network and consequently was not included in the analysis.
  • 2 (Network element not located)—The network element identified by the point's network location fields can't be found. This can occur when a network element where the point should be was deleted, and the network location was not recalculated.
  • 3 (Element not traversable)—The network element that the point is located on is not traversable. This can occur when the element is restricted by a restriction attribute.
  • 4 (Invalid Field Values)—Field values fall outside a range or coded-value domain. For example, a negative number exists where positive numbers are required.
  • 5 (Not Reached)—The point can't be reached by the solver. The point may be on a separate, disconnected area of the network from the other inputs, or barriers or restrictions prevent travel to or from the point.
  • 6 (Time window violation)—The point could not be reached within the designated time windows. This status only applies to network analysis types that support time windows.
  • 7 (Not located on closest)—The closest network location to the point is not traversable because of a restriction or barrier, so the point has been located on the closest traversable network feature instead.

SnapX

The x-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset.

SnapY

The y-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset.

SnapZ

The z-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset. The SnapZ field is 0 if the network is two dimensional.

DistanceToNetworkInMeters

The distance in meters between the point's geographic location and the position where it was located on the network.

Bearing

The values for this field are copied from the Bearing field on the input demand points.

BearingTol

The values for this field are copied from the BearingTol field on the input demand points.

NavLatency

The values for this field are copied from the NavLatency field on the input demand points.

output_allocation_lines

This provides access to the lines that connect demand points to the facilities to which they are allocated. Such lines are referenced in the documentation as allocation lines. These allocation lines include data about the demand allocated from each demand point to the associated facility.

The parameter supports the following fields:

FieldDescription

Name

The name of the allocation line that includes the names of the demand point and facility to which the demand point is allocated.

The name of the allocation line is based on the names of the associated facility and demand point.

The facility name is first if the Travel Direction parameter value is set to Facility To Demand. For example, Facility 5 - Demand 3 indicates that the route travels from Facility 5 to Demand 3.

If Demand To Facility is specified as the Travel Direction parameter value, the demand point name is first, for example, Demand 3 — Facility 5 .

Weight

The weight assigned from the connected demand point to the connected facility.

FacilityOID

The ObjectID value of the corresponding input facility feature. This field is often used to join information from the facilities to the allocation lines.

DemandOID

The ObjectID value of the corresponding input demand point feature. This field is often used to join information from the demand points to the allocation lines.

Total_Minutes

The travel time in minutes between the facility and the demand point. Although the allocation lines have either straight or null geometries, the cost always refers to travel times as measured on a transportation network, not straight-line distances.

TotalWeighted_Minutes

The weighted cost of traveling between the facility and the demand point in minutes. This is the Total_Minutes value multiplied by the weight of the demand point allocated to the facility.

This field is included only if the travel mode set for the analysis has an impedance attribute that is time based.

Total_Miles

The travel distance in miles between the facility and the demand point. Although the allocation lines have either straight or null geometries, the cost always refers to travel distances as measured on a transportation network, not straight-line distances.

Total_Kilometers

The travel distance in kilometers between the facility and the demand point. Although the allocation lines have either straight or null geometries, the cost always refers to travel distances as measured on a transportation network, not straight-line distances.

TotalWeighted_Miles

The weighted cost of traveling between the facility and the demand point in miles. This is the Total_Miles value multiplied by the weight of the demand point allocated to the facility.

This field is included only if the travel mode set for the analysis has an impedance attribute that is distance based.

TotalWeighted_Kilometers

The weighted cost of traveling between the facility and the demand point in kilometers. This is the Total_Kilometers value multiplied by the weight of the demand point allocated to the facility.

This field is included only if the travel mode set for the analysis has an impedance attribute that is distance based.

Total_Other

The travel cost in unknown units between the facility and the demand point. Although the allocation lines have either straight or null geometries, the cost always refers to travel cost as measured on a transportation network, not straight-line distances.

This field is included only when the travel mode used for the analysis has an impedance attribute that is neither time based nor distance based.

TotalWeighted_Other

The weighted cost of traveling between the facility and the demand point in unknown units. This is the Total_Cost value multiplied by the weight of the demand point allocated to the facility.

This field is included only if the travel mode set for the analysis has an impedance attribute that is neither time based nor distance based.

usage_cost

This parameter returns the credits used by the analysis.

Syntax example for usage_cost

The usage_cost parameter is returned as a JSON with the following syntax:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
    "paramName": "Usage_Cost",
    "dataType": "GPString",
    "value": {
        "numObjects": "<number>",
        "credits": "<number>"
    }
}

Example for usage_cost

The following shows an example of the usage_cost parameter in which the analysis generated 9 billable objects (represented by numObjects ) and 4.5 credits were used by the analysis.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
    "paramName": "Usage_Cost",
    "dataType": "GPString",
    "value": {
        "numObjects": 9,
        "credits": 4.5
    }
}

solve_succeeded

Use this parameter to determine if the service was able to successfully choose the best facilities. The error messages for any 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:

Use dark colors for code blocksCopy
1
2
3
4
5
{
    "paramName": "Solve_Succeeded",
    "dataType": "GPBoolean",
    "value": <true | false>
}

The following shows an example of the solve_succeeded parameter:

Use dark colors for code blocksCopy
1
2
3
4
5
{
    "paramName": "Solve_Succeeded",
    "dataType": "GPBoolean",
    "value": true
}

output_result_file

Use this parameter to access the results from the analysis as a .zip file containing one or more files for each output. The format of the individual file is specified by the Output Format parameter. The parameter value is not populated when the Output Format parameter is set to Feature Set.

output_network_analysis_layer

Use this parameter to access the network analysis layer file that stores the analysis settings and the inputs and outputs used for the analysis. The parameter value is populated only when the Save Output Network Analysis Layer parameter is set to True.

Usage limits

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

Limit DescriptionLimit Value

Maximum number of facilities:

1,000

Maximum number of facilities to find:

100

Maximum number of demand points:

10,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

Force hierarchy beyond a straight-line distance of:

(If the straight-line distance between any facility and demand point is greater than the limit shown here, the analysis uses hierarchy, even if useHierarchy is set to false.)

50 miles (80.46 kilometers)

Maximum time a client can use the job request service:

1 hour (3,600 seconds)

Examples

Choose the best store location

In this example, you will find the one store location that provides the best access to customers.

Before performing the analysis, you would typically need to find locations that could accommodate your store. This may include surveying the real estate market to find commercial properties that are the right size and have the right price. The candidate facilities are specified with the facilities facilities parameter. Households are added as demand_points and weighted by the number of people living there. They represent potential customers.

The facilities and demand points are in the default spatial reference, WGS84, so the spatialReference property is not required.

Request URL to submit the job

The first request submits a job and returns the job id.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/submitJob?
facilities={"features":[{"attributes":{"OBJECTID":1,"Name":"Facility A","FacilityType":0,"CurbApproach":0},"geometry":{"x":-58.557329417999938,"y":-34.587693706999971}},
{"attributes":{"OBJECTID":2,"Name":"Facility B","FacilityType":0,"CurbApproach":0},"geometry":{"x":-58.460247408999976,"y":-34.683348039999942}}]}&
demand_points={"features":[{"attributes":{"OBJECTID":1,"Name":"Household 4","GroupName":"A","Weight":2,"CurbApproach":0},"geometry":{"x":-58.664405163999959,"y":-34.614819562999969}},
{"attributes":{"OBJECTID":2,"Name":"Household 3","GroupName":"A","Weight":2,"CurbApproach":0},"geometry":{"x":-58.514499119999982,"y":-34.496322404999944}},
{"attributes":{"OBJECTID":3,"Name":"Household 2","GroupName":null,"Weight":3,"CurbApproach":0},"geometry":{"x":-58.54162497599998,"y":-34.788996107999935}},
{"attributes":{"OBJECTID":4,"Name":"Household 1","GroupName":null,"Weight":5,"CurbApproach":1},"geometry":{"x":-58.40599569799997,"y":-34.637662387999967}}]}&
f=pjson&token=<yourToken>
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/submitJob?
facilities=%7B%22features%22:%5B%7B%22attributes%22:%7B%22OBJECTID%22:1,%22Name%22:%22Facility%20A%22,%22FacilityType%22:0,%22CurbApproach%22:0%7D,%22geometry%22:%7B%22x%22:-58.557329417999938,
%22y%22:-34.587693706999971%7D%7D,%7B%22attributes%22:%7B%22OBJECTID%22:2,%22Name%22:%22Facility%20B%22,%22FacilityType%22:0,%22CurbApproach%22:0%7D,%22geometry%22:%7B%22x%22:-58.460247408999976,
%22y%22:-34.683348039999942%7D%7D%5D%7D&demand_points=%7B%22features%22:%5B%7B%22attributes%22:%7B%22OBJECTID%22:1,%22Name%22:%22Household%204%22,%22GroupName%22:%22A%22,%22Weight%22:2,
%22CurbApproach%22:0%7D,%22geometry%22:%7B%22x%22:-58.664405163999959,%22y%22:-34.614819562999969%7D%7D,%7B%22attributes%22:%7B%22OBJECTID%22:2,%22Name%22:%22Household%203%22,
%22GroupName%22:%22A%22,%22Weight%22:2,%22CurbApproach%22:0%7D,%22geometry%22:%7B%22x%22:-58.514499119999982,%22y%22:-34.496322404999944%7D%7D,%7B%22attributes%22:%7B%22OBJECTID%22:3,
%22Name%22:%22Household%202%22,%22GroupName%22:null,%22Weight%22:3,%22CurbApproach%22:0%7D,%22geometry%22:%7B%22x%22:-58.54162497599998,%22y%22:-34.788996107999935%7D%7D,%7B%22attributes
%22:%7B%22OBJECTID%22:4,%22Name%22:%22Household%201%22,%22GroupName%22:null,%22Weight%22:5,%22CurbApproach%22:1%7D,%22geometry%22:%7B%22x%22:-58.40599569799997,
%22y%22:-34.637662387999967%7D%7D%5D%7D&f=pjson&token=<yourToken>

JSON response

Use dark colors for code blocksCopy
1
2
3
4
{
    "jobId": "jb937dc0c7e324e68b95923c8fd9c8a1b",
    "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.

Use dark colors for code blocksCopy
1
2
https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<jobID>?returnMessages=true&
f=pjson&token=<yourToken>
Use dark colors for code blocksCopy
1
2
https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<jobID>?returnMessages=true&
f=pjson&token=<yourToken>

JSON response

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
 "jobId": "jb937dc0c7e324e68b95923c8fd9c8a1b",
 "jobStatus": "esriJobSucceeded",
 "results": {
  "Solve_Succeeded": {
   "paramUrl": "results/Solve_Succeeded"
  },
  "Output_Allocation_Lines": {
   "paramUrl": "results/Output_Allocation_Lines"
  },
  "Output_Facilities": {
   "paramUrl": "results/Output_Facilities"
  },
  "Output_Demand_Points": {
   "paramUrl": "results/Output_Demand_Points"
  }
 },
 "inputs": {
  "Facilities": {
   "paramUrl": "inputs/Facilities"
  },
  "Demand_Points": {
   "paramUrl": "inputs/Demand_Points"
  },
  "Measurement_Units": {
   "paramUrl": "inputs/Measurement_Units"
  },
  "Analysis_Region": {
   "paramUrl": "inputs/Analysis_Region"
  },
  "Problem_Type": {
   "paramUrl": "inputs/Problem_Type"
  },
  "Number_of_Facilities_to_Find": {
   "paramUrl": "inputs/Number_of_Facilities_to_Find"
  },
  "Default_Measurement_Cutoff": {
   "paramUrl": "inputs/Default_Measurement_Cutoff"
  },
  "Default_Capacity": {
   "paramUrl": "inputs/Default_Capacity"
  },
  "Target_Market_Share": {
   "paramUrl": "inputs/Target_Market_Share"
  },
  "Measurement_Transformation_Model": {
   "paramUrl": "inputs/Measurement_Transformation_Model"
  },
  "Measurement_Transformation_Factor": {
   "paramUrl": "inputs/Measurement_Transformation_Factor"
  },
  "Travel_Direction": {
   "paramUrl": "inputs/Travel_Direction"
  },
  "Time_of_Day": {
   "paramUrl": "inputs/Time_of_Day"
  },
  "Time_Zone_for_Time_of_Day": {
   "paramUrl": "inputs/Time_Zone_for_Time_of_Day"
  },
  "UTurn_at_Junctions": {
   "paramUrl": "inputs/UTurn_at_Junctions"
  },
  "Point_Barriers": {
   "paramUrl": "inputs/Point_Barriers"
  },
  "Line_Barriers": {
   "paramUrl": "inputs/Line_Barriers"
  },
  "Polygon_Barriers": {
   "paramUrl": "inputs/Polygon_Barriers"
  },
  "Use_Hierarchy": {
   "paramUrl": "inputs/Use_Hierarchy"
  },
  "Restrictions": {
   "paramUrl": "inputs/Restrictions"
  },
  "Attribute_Parameter_Values": {
   "paramUrl": "inputs/Attribute_Parameter_Values"
  },
  "Allocation_Line_Shape": {
   "paramUrl": "inputs/Allocation_Line_Shape"
  }
 },
 "messages": [

 ]
}

Request URL to return the output facilities

Because the job succeeded, a request can be made to return the facilities using the output_facilities output parameter.

Use dark colors for code blocksCopy
1
2
https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<jobID>/results/output_facilities?
f=pjson&token=<yourToken>
Use dark colors for code blocksCopy
1
2
https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<jobID>/results/output_facilities?
f=pjson&token=<yourToken>
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
 "paramName": "Output_Facilities",
 "dataType": "GPFeatureRecordSetLayer",
 "value": {
  "displayFieldName": "",
  "geometryType": "esriGeometryPoint",
  "spatialReference": {
   "wkid": 4326,
   "latestWkid": 4326
  },
  "fields": [
   {
    "name": "OID",
    "type": "esriFieldTypeOID",
    "alias": "OID"
   },
   {
    "name": "Name",
    "type": "esriFieldTypeString",
    "alias": "Name",
    "length": 128
   },
   {
    "name": "FacilityType",
    "type": "esriFieldTypeInteger",
    "alias": "FacilityType"
   },
   {
    "name": "Weight",
    "type": "esriFieldTypeDouble",
    "alias": "Weight"
   },
   {
    "name": "Capacity",
    "type": "esriFieldTypeDouble",
    "alias": "Capacity"
   },
   {
    "name": "DemandCount",
    "type": "esriFieldTypeInteger",
    "alias": "DemandCount"
   },
   {
    "name": "DemandWeight",
    "type": "esriFieldTypeDouble",
    "alias": "DemandWeight"
   },
   {
    "name": "CurbApproach",
    "type": "esriFieldTypeInteger",
    "alias": "CurbApproach"
   },
   {
    "name": "Status",
    "type": "esriFieldTypeInteger",
    "alias": "Status"
   },
   {
    "name": "Total_Minutes",
    "type": "esriFieldTypeDouble",
    "alias": "Total_Minutes"
   },
   {
    "name": "TotalWeighted_Minutes",
    "type": "esriFieldTypeDouble",
    "alias": "TotalWeighted_Minutes"
   },
   {
    "name": "FacilityOID",
    "type": "esriFieldTypeInteger",
    "alias": "FacilityOID"
   }
  ],
  "features": [
   {
    "attributes": {
     "OID": 1,
     "Name": "Facility A",
     "FacilityType": 0,
     "Weight": 1,
     "Capacity": 20,
     "DemandCount": 0,
     "DemandWeight": 0,
     "CurbApproach": 0,
     "Status": 0,
     "Total_Minutes": 0,
     "TotalWeighted_Minutes": 0,
     "FacilityOID": 1
    },
    "geometry": {
     "x": -58.557329417999938,
     "y": -34.587693706999971
    }
   },
   {
    "attributes": {
     "OID": 2,
     "Name": "Facility B",
     "FacilityType": 3,
     "Weight": 1,
     "Capacity": 20,
     "DemandCount": 4,
     "DemandWeight": 12,
     "CurbApproach": 0,
     "Status": 0,
     "Total_Minutes": 98.15948274044834,
     "TotalWeighted_Minutes": 255.65998780240028,
     "FacilityOID": 2
    },
    "geometry": {
     "x": -58.460247408999976,
     "y": -34.683348039999942
    }
   }
  ],
  "exceededTransferLimit": false
 }
}

Request URL to return the output demand points

The output demand points are requested using output_demand_points .

Use dark colors for code blocksCopy
1
2
https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<jobID>/results/output_demand_points?
f=pjson&token=<yourToken>
Use dark colors for code blocksCopy
1
2
https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<jobID>/results/
output_demand_points?f=pjson&token=<yourToken>
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{
 "paramName": "Output_Demand_Points",
 "dataType": "GPFeatureRecordSetLayer",
 "value": {
  "displayFieldName": "",
  "geometryType": "esriGeometryPoint",
  "spatialReference": {
   "wkid": 4326,
   "latestWkid": 4326
  },
  "fields": [
   {
    "name": "OID",
    "type": "esriFieldTypeOID",
    "alias": "OID"
   },
   {
    "name": "Name",
    "type": "esriFieldTypeString",
    "alias": "Name",
    "length": 128
   },
   {
    "name": "Weight",
    "type": "esriFieldTypeDouble",
    "alias": "Weight"
   },
   {
    "name": "AllocatedWeight",
    "type": "esriFieldTypeDouble",
    "alias": "AllocatedWeight"
   },
   {
    "name": "GroupName",
    "type": "esriFieldTypeString",
    "alias": "GroupName",
    "length": 128
   },
   {
    "name": "CurbApproach",
    "type": "esriFieldTypeInteger",
    "alias": "CurbApproach"
   },
   {
    "name": "Status",
    "type": "esriFieldTypeInteger",
    "alias": "Status"
   },
   {
    "name": "DemandOID",
    "type": "esriFieldTypeInteger",
    "alias": "DemandOID"
   },
   {
    "name": "FacilityOID",
    "type": "esriFieldTypeInteger",
    "alias": "FacilityOID"
   },
   {
    "name": "TimeCutoff",
    "type": "esriFieldTypeDouble",
    "alias": "Time Cutoff"
   }
  ],
  "features": [
   {
    "attributes": {
     "OID": 1,
     "Name": "Household 4",
     "Weight": 2,
     "AllocatedWeight": 2,
     "GroupName": "A",
     "CurbApproach": 0,
     "Status": 0,
     "DemandOID": 1,
     "FacilityOID": 2,
     "TimeCutoff": null
    },
    "geometry": {
     "x": -58.664405163999959,
     "y": -34.614819562999969
    }
   },
   {
    "attributes": {
     "OID": 2,
     "Name": "Household 3",
     "Weight": 2,
     "AllocatedWeight": 2,
     "GroupName": "A",
     "CurbApproach": 0,
     "Status": 0,
     "DemandOID": 2,
     "FacilityOID": 2,
     "TimeCutoff": null
    },
    "geometry": {
     "x": -58.514499119999982,
     "y": -34.496322404999944
    }
   },
   {
    "attributes": {
     "OID": 3,
     "Name": "Household 2",
     "Weight": 3,
     "AllocatedWeight": 3,
     "GroupName": null,
     "CurbApproach": 0,
     "Status": 0,
     "DemandOID": 3,
     "FacilityOID": 2,
     "TimeCutoff": null
    },
    "geometry": {
     "x": -58.54162497599998,
     "y": -34.788996107999935
    }
   },
   {
    "attributes": {
     "OID": 4,
     "Name": "Household 1",
     "Weight": 5,
     "AllocatedWeight": 5,
     "GroupName": null,
     "CurbApproach": 1,
     "Status": 0,
     "DemandOID": 4,
     "FacilityOID": 2,
     "TimeCutoff": null
    },
    "geometry": {
     "x": -58.40599569799997,
     "y": -34.637662387999967
    }
   }
  ],
  "exceededTransferLimit": false
 }
}

Request URL to return the output allocation lines

The lines connecting demand points to the facilities they are allocated to are requested using the output_allocation_lines output parameter.

Use dark colors for code blocksCopy
1
2
https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<jobID>/results/
output_allocation_lines?f=pjson&token=<yourToken>
Use dark colors for code blocksCopy
1
2
https://logistics.arcgis.com/arcgis/rest/services/World/LocationAllocation/GPServer/SolveLocationAllocation/jobs/<jobID>/results/
output_allocation_lines?f=pjson&token=<yourToken>
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
{
 "paramName": "Output_Allocation_Lines",
 "dataType": "GPFeatureRecordSetLayer",
 "value": {
  "displayFieldName": "",
  "geometryType": "esriGeometryPolyline",
  "spatialReference": {
   "wkid": 4326,
   "latestWkid": 4326
  },
  "fields": [
   {
    "name": "OID",
    "type": "esriFieldTypeOID",
    "alias": "OID"
   },
   {
    "name": "Name",
    "type": "esriFieldTypeString",
    "alias": "Name",
    "length": 128
   },
   {
    "name": "Weight",
    "type": "esriFieldTypeDouble",
    "alias": "Weight"
   },
   {
    "name": "TotalWeighted_Minutes",
    "type": "esriFieldTypeDouble",
    "alias": "TotalWeighted_Minutes"
   },
   {
    "name": "Total_Minutes",
    "type": "esriFieldTypeDouble",
    "alias": "Total_Minutes"
   },
   {
    "name": "Total_Miles",
    "type": "esriFieldTypeDouble",
    "alias": "Total_Miles"
   },
   {
    "name": "FacilityOID",
    "type": "esriFieldTypeInteger",
    "alias": "FacilityOID"
   },
   {
    "name": "DemandOID",
    "type": "esriFieldTypeInteger",
    "alias": "DemandOID"
   },
   {
    "name": "Total_Kilometers",
    "type": "esriFieldTypeDouble",
    "alias": "Total_Kilometers"
   },
   {
    "name": "Shape_Length",
    "type": "esriFieldTypeDouble",
    "alias": "Shape_Length"
   }
  ],
  "features": [
   {
    "attributes": {
     "OID": 1,
     "Name": "Facility B - Household 4",
     "Weight": 2,
     "TotalWeighted_Minutes": 60.168576445604977,
     "Total_Minutes": 30.084288222802488,
     "Total_Miles": 15.37109520474797,
     "FacilityOID": 2,
     "DemandOID": 1,
     "Total_Kilometers": 24.737380000000002,
     "Shape_Length": 0.21535213276531256
    },
    "geometry": {
     "paths": [
      [
       [
        -58.460247408999976,
        -34.683348039999942
       ],
       [
        -58.664405163999959,
        -34.614819562999969
       ]
      ]
     ]
    }
   },
   {
    "attributes": {
     "OID": 2,
     "Name": "Facility B - Household 3",
     "Weight": 2,
     "TotalWeighted_Minutes": 72.1604586665743,
     "Total_Minutes": 36.08022933328715,
     "Total_Miles": 17.676695567632418,
     "FacilityOID": 2,
     "DemandOID": 2,
     "Total_Kilometers": 28.447880000000001,
     "Shape_Length": 0.1947352980165141
    },
    "geometry": {
     "paths": [
      [
       [
        -58.460247408999976,
        -34.683348039999942
       ],
       [
        -58.514499119999982,
        -34.496322404999944
       ]
      ]
     ]
    }
   },
   {
    "attributes": {
     "OID": 3,
     "Name": "Facility B - Household 2",
     "Weight": 3,
     "TotalWeighted_Minutes": 54.965809847358813,
     "Total_Minutes": 18.321936615786271,
     "Total_Miles": 9.9908299927555344,
     "FacilityOID": 2,
     "DemandOID": 3,
     "Total_Kilometers": 16.078679999999999,
     "Shape_Length": 0.13335599980117666
    },
    "geometry": {
     "paths": [
      [
       [
        -58.460247408999976,
        -34.683348039999942
       ],
       [
        -58.54162497599998,
        -34.788996107999935
       ]
      ]
     ]
    }
   },
   {
    "attributes": {
     "OID": 4,
     "Name": "Facility B - Household 1",
     "Weight": 5,
     "TotalWeighted_Minutes": 68.365142842862213,
     "Total_Minutes": 13.673028568572441,
     "Total_Miles": 5.0529893827094323,
     "FacilityOID": 2,
     "DemandOID": 4,
     "Total_Kilometers": 8.1319999999999997,
     "Shape_Length": 0.070925502783490982
    },
    "geometry": {
     "paths": [
      [
       [
        -58.460247408999976,
        -34.683348039999942
       ],
       [
        -58.40599569799997,
        -34.637662387999967
       ]
      ]
     ]
    }
   }
  ],
  "exceededTransferLimit": false
 }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.