Location-allocation
The best location for a new fast-food restaurant that can serve additional customers. The location-allocation service can allocate demand to existing locations (the restaurant location shown with the black filled circle) and can help you find one or more new locations (the restaurant location shown with a star) that can maximize the number of customers that can walk to your restaurant.
What is location-allocation?
Location-allocation is the process of finding a set of facilities that will best serve demand from surrounding areas. As the name suggests, location-allocation is a two-fold problem that simultaneously locates facilities and allocates demand points to the facilities.
You can use location-allocation to build applications that answer questions such as:
- 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 maximize the overall demand?
- Where should a factory be built to minimize the distance to distribution centers?
How location-allocation works
The typical workflow for location-allocation analysis is to define:
- One or more locations that serve as facilities.
- One or more locations that represent demand for the services offered at the facilities.
- The type of travel for the analysis.
- The objective of the location-allocation analysis such as maximize the attendance or minimize the travel time.
- Number of facilities the service should choose.
- Call the service to find the best locations for the facilities and allocate demand to the chosen facilities.
URL requests
You can perform location allocation by making an HTTPS request to the location-allocation service submit
operation or by using client APIs. Specify one or more facilities, demand points, the location-allocation problem type, and additional parameters to refine the operation. Some of the most common parameters are described below.
Location-allocation only supports job requests.
URL
Required parameters
Name | Description | Examples |
---|---|---|
f | The format of the data returned. | f=json f=pjson |
token | An API key or OAuth 2.0 access token. Learn how to get an access token in Security and authentication. | token=< token=< |
Key parameters
Name | Description | Examples |
---|---|---|
facilities | One or more locations that serve as facilities. | facilities={"features":[{"geometry":{"x":-117.195696,"y":34.056503}}]} |
demand_ | One or more locations that represent demand for the services offered at the facilities. | demand_ |
travel_ | The mode of transportation such as driving a car or a truck or walking. | travel JSON Object |
problem_ | The objective of the location-allocation analysis | problem_ |
number_ | Number of facilities the service should choose | number_ |
Additional parameters: Set additional constraints when performing location-allocation such as default_
to limit the travel time or travel distance between a facility and a demand point, ortravel_
to indicate if travel occurs from facility to demand points or vice versa.
Code examples
Job: Find new restaurant location
In this example, the best location for a new fast-food restaurant is found to serve additional customers. A restaurant already exists in the downtown central business district that is popular with employees who work at the nearby offices. You want to expand your business by opening one more branch that can cater to more employees from nearby office buildings.
To solve this problem using the location-allocation service, you need to provide the appropriate inputs to the service that are described below:
The office buildings are the
demand_
. They have a field calledpoints Weight
that represents the number of people working in those buildings and so can be your potential customers.The existing and prospective locations for the restaurants are the
facilities
. As you still want to run the existing restaurant, theFacility
value for this location isType 1
so that the location-allocation service will always include this facility in the final solution. You have identified four other potential locations where you can start a new branch of your restaurant. TheFacility
on these four locations isType 0
so that the location-allocation service will select the best from these four in addition to the existing location.The customers are walking to your restaurant. So you set the
travel_
as walking time.mode Location-allocation service supports various problem types that have different goals. Picking the correct problem type is important to get expected results. In this scenario, you want to chose the new location such that it can attract maximum number of customers that are closest to new location so that they don't have to walk a lot to reach your restaurant from their offices. So you need to select the
Maximize Attendance
problem type as it is designed to achieve this goal.You need to find one new restaurant location in addition to the existing location. So you set the
number_
aso f_ facilities_ t o_ find 2
. The location-allocation service will first allocate the customers to the existing restaurant and then allocate the remaining customers to the best location out of the four candidates that you have selected.The
travel_
is set asdirection Demand To Facility
since the customers will be visiting the restaurant from their offices.
APIs
REST API
Unlike Direct request type which allows you to make a request and get back all the results in the response, when working with a Job request type, you need to follow a three step workflow:
- Make the
submit
request with the appropriate request parameters to get a job id.Job - Using the job id, check the job status to see if the job completed successfully.
- Use the job id to get one or more results.
Tutorials

Find a route and directions
Find a route and directions with the routing service.

Find service areas
Create an isochrone with driving distance with the routing service.
Services
Routing service
Get turn-by-turn directions and solve advanced routing problems.
API support
Routing | Optimized Routing | Fleet routing | Closest facility routing | Service areas | Location-allocation | Travel cost matrix | |
---|---|---|---|---|---|---|---|
ArcGIS Maps SDK for JavaScript | 1 | 1 | 1 | ||||
ArcGIS Maps SDK for .NET | 1 | 1 | 1 | ||||
ArcGIS Maps SDK for Kotlin | 1 | 1 | 1 | ||||
ArcGIS Maps SDK for Swift | 1 | 1 | 1 | ||||
ArcGIS Maps SDK for Java | 1 | 1 | 1 | ||||
ArcGIS Maps SDK for Qt | 1 | 1 | 1 | ||||
ArcGIS API for Python | |||||||
ArcGIS REST JS | |||||||
Esri Leaflet | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
MapLibre GL JS | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
OpenLayers | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
- 1. Access with geoprocessing task.
- 2. Access via ArcGIS REST JS.
Tools
Developer dashboard
Manage API keys, service usage, and data with the ArcGIS Developers website.
ArcGIS Online
Create, manage, and share content and data with cloud-based GIS tools.
Map Viewer
Create, explore, and share web maps for 2D applications.
Scene Viewer
Create, explore, and share web scenes for 3D applications.
ArcGIS Pro
Explore, visualize, and analyze both 2D and 3D data with desktop GIS tools.