GET https://route-api.arcgis.com/arcgis/rest/services/World/ClosestFacility/NAServer/ClosestFacility_World/solveClosestFacilityThe /solve direct request finds one or more nearby facilities from incidents based on travel time or travel distance.
When finding the closest facilities, you can specify how many to find and whether the direction of travel is toward or away from them. Once you've found the closest facilities, you can display the best route to or from them and include the travel time, travel distance, and driving directions to each facility.
The service can use current traffic conditions when determining the best routes. You can also specify an impedance cutoff beyond which the service will not search for a facility. For instance, you can set up a Closest facility service to search for hospitals within a 15-minute drive time of the site of an accident. Any hospitals that take longer than 15 minutes to reach will not be included in the results. The hospitals are referred to as facilities, and the accident is referred to as an incident. The service allows you to perform multiple closest facility analyses simultaneously. This means you can have multiple incidents and find the closest facility or facilities to each incident.
Parameters
| Name | Required | Type | Default | Description |
|---|---|---|---|---|
f | string | The request response format, either | ||
token | string | An access token with the required privileges. | ||
incidents | locations | feature | One or more locations from which the nearby locations are searched. | ||
facilities | locations | feature | One or more locations that are searched for when finding the closest location. | ||
returnCFRoutes | string |
| Return routes. | |
travelMode | object | The mode of transportation for the analysis provided as a JSON object. | ||
defaultTargetFacilityCount | string | The number of closest facilities to find per incident. | ||
travelDirection | string |
| Search for the closest facility as measured from the incident to the facility or from the facility to the incident. | |
defaultCutoff | number |
| The travel time or travel distance value at which to stop searching for facilities for a given incident. | |
timeOfDay | string | The time and date to depart from or arrive at incidents or facilities. | ||
timeOfDayIsUTC | boolean |
| The time zone or zones of the | |
timeOfDayUsage | string |
| Specifies whether the | |
restrictUTurns | string |
| Restricts or allows a route to make U-turns at junctions. | |
useHierarchy | boolean |
| Hierarchy used when finding the shortest paths. | |
impedanceAttributeName | string |
| Type of impedance. | |
accumulateAttributeNames | string |
| Accumulates values other than the value set in the | |
restrictionAttributeNames | string | The restrictions that should be honored by the service. | ||
attributeParameterValues | [object] | Additional values required by an attribute or restriction. | ||
barriers | locations | feature | One or more points that act as temporary restrictions, additional time, or distance. | ||
polylineBarriers | feature | One ore more lines that prohibit travel anywhere the lines intersect the streets. | ||
polygonBarriers | feature | Polygons that either prohibit travel or proportionately scale the time or distance required to travel on the streets. | ||
returnDirections | boolean |
| Generates the driving directions for each route. | |
directionsLanguage | string |
| The language used when generating driving directions. | |
directionsOutputType | string |
| The content and length of the driving directions. Used if | |
directionsStyleName | string |
| The formatting style for the directions. Used if | |
directionsLengthUnits | string |
| The units to display the travel distance in driving directions. Used if | |
directionsTimeAttributeName | string |
| The time-based impedance attribute to display the duration of a maneuver. | |
outputLines | string |
| The type of route features that are returned. | |
returnFacilities | boolean |
| Returns facilities. | |
returnIncidents | boolean |
| Returns incidents. | |
returnBarriers | boolean |
| Returns barriers. | |
returnPolylineBarriers | boolean |
| Returns polyline barriers. | |
returnPolygonBarriers | boolean |
| Returns polygon barriers. | |
returnTraversedEdges | boolean |
| Returns traversed edges. | |
returnTraversedJunctions | boolean |
| Returns traversed junctions. | |
returnTraversedTurns | boolean |
| Returns traversed turns. | |
ignoreInvalidLocations | boolean |
| Ignores invalid input locations. | |
context | string | Additional settings that affect task operation | ||
outputGeometryPrecision | number |
| Simplifies route geometry. | |
outputGeometryPrecisionUnits | string |
| The units for the value in the | |
geometryPrecision | integer | The number of decimal places in the response geometries. Applies to x and y values only. | ||
geometryPrecisionM | string | The number of decimal places in the response geometries. Applies to m-values only. | ||
overrides | string | For internal use only. | ||
preserveObjectID | boolean |
| Preserves the object IDs from input locations when the input locations are returned as output. | |
returnEmptyResults | boolean |
| Returns empty results instead of the error property when a request fails. | |
locateSettings | object | Determines how input data are located. |
Required parameters
token
An access token with the required privileges.
- ArcGIS Location Platform: premium:user:networkanalysis:closestfacility
- ArcGIS Online: premium:user:networkanalysis
token=<ACCESS_TOKEN>To use HTTP headers instead of the token parameter, set the following:
GET <SERVICE_REQUEST> HTTP/1.1
Host: <SERVICE_DOMAIN>
X-Esri-Authorization: Bearer <ACCESS_TOKEN>Learn more about access tokens and privileges in the Security and authentication developer guide.
incidents
Specify one or more locations from which the service searches for the nearby locations. These locations are referred to as incidents.
When specifying the stops, you can set attributes for each as follows:
Show attributes for incidents
Attributes for incidents
-
Namestring (length: 500)nullable
The name of the incident. The name is used in the driving directions. If the name is not specified, a unique name prefixed with Location is automatically generated in the output routes and directions.
-
ObjectIDinteger (non-negative)nullable
The object ID of the incident.
Objectis a unique identifier for the incident. If you want to maintain a relationship between input and output, setID preservetoObject ID true, and theObjectvalue of the input incident is included in the output routes (as the IncidentID field). TheID Objectvalue is also included in the output incidents (as theID Objectfield) and can be used to join additional information from the analysis outputs to the attribute of the incidents. If theID Objectvalue is not specified, a uniqueID IDis automatically generated in the output.
-
TargetFacilityCountintegerdefault:null
Specify the number of facilities that need to be found for the given incident.
If
Targetis not set for an incident, the service will use the value specified as theFacility Count defaultparameter. The value for theTarget Facility Count Targetattribute allows the ability to overwrite theFacility Count defaultvalue on a per incident basis. The default value for this attribute is null , which causes the service to use the value set for theTarget Facility Count defaultparameter. If theTarget Facility Count Targetattribute is set to a value other than null , theFacility Count defaultvalue is overwritten.Target Facility Count
-
Attr_[Cost]number (non-negative)default:0nullable
The name of the attribute can be:
Attr,_Travel Time Attr,_Truck Travel Time Attr,_Minutes Attr,_Truck Minutes Attr,_Walk Time Attr,_Miles Attr_Kilometers This attribute specifies how much additional time spent or distance traveled can occur at the incident. The value for this attribute is included in the total travel time or distance for the output routes and is also displayed in output directionPoints as service time.
The value for this attribute is specified in the units of the cost attribute. For instance,
Attris in minutes._Travel Time Use case
You can add time to an incident to represent how long it takes to make a delivery, install equipment, or perform some other task at the incident. Similarly, adding extra distance may be useful to account for a long driveway or other road that isn't represented by the network dataset. When a time-based cost attribute
Travelis used, it will specify the travel time for cars, in minutes, that will be added to the total travel time of the route between the incident and the closest facility. The attribute value can be used to model the time spent at the incident.Time For example, if you are finding the three closest fire stations from a fire incident, the attribute can store the amount of time spent at the fire incident. This could be the time it takes for firefighters to hook up their equipment and begin fighting the fire. The value for this attribute is included in the total travel time for the route and is also displayed in driving directions as service time.
Attris only referenced if_Travel Time Travelis used in the analysis as impedance or accumulate attribute. A zero or null value indicates that the incident requires no service time.Time However, when a distance-based cost attribute like
Milesis used, it specifies the distance in miles that will be added to the total distance of the route between the incident and the closest facility. Generally the locations of the incidents are not exactly on the streets but are set back somewhat from the road. TheAttrattribute can be used to model the distance between the actual incident location and its location on the street if it is important to include that distance in the total travel distance._Miles Attris only referenced if_Miles Milesis used in the analysis as impedance or accumulate attribute.
-
Cutoff_[Impedance]number (non-negative)default:null
Specify the travel time or distance at which to stop searching for facilities for a given incident.
If
Cutoffis not set for an incident, the service will use the value specified as the_[ Impedance] defaultparameter. The default value for this attribute is null, which causes the service to use the value set for theCutoff defaultparameter. If theCutoff Cutoffattribute is set to a value other than null, the_[ Impedance] defaultvalue is overridden.Cutoff Use case
For example, when a time-based cutoff impedance
Travelis used, it will specify the travel time for cars, in minutes, at which to stop searching for facilities for a given incident. Any incident beyond the cutoff value will not be searched. IfTime Cutoffis not set for an incident, the service will use the value specified as the_Travel Time defaultparameter. The value for theCutoff Cutoffattribute allows the ability to overwrite the_Travel Time defaultvalue on a per facility basis. The default value for this attribute isCutoff null, which indicates not to use any cutoff.However, when a distance-based cutoff impedance like
Milesis used, it will specify the travel distance in miles at which to stop searching for facilities for a given incident. Any incident beyond the cutoff value will not be searched. IfCutoffis not set for a facility, the service will use the value specified as the_Miles defaultparameter. The value for theCutoff Cutoffattribute allows the ability to overwrite the_Miles defaultvalue on a per facility basis. The default value for this attribute isCutoff null, which indicates not to use any cutoff.
-
CurbApproachint enumdefault:0
Allowed values:
0,1,2,3Specifies the direction a vehicle may arrive at and depart from the incident. The field value is specified as one of the following integers:
0: Either side of vehicle. The vehicle can approach and depart the incident in either direction. U-turns are allowed. You should choose this setting if your vehicle can make a U-turn at the order or if it can pull into a driveway or parking lot and turn around.1: Right side of vehicle. When the vehicle approaches and departs the incident, the curb must be on the right side of the vehicle. A U-turn is prohibited.2: Left side of vehicle. When the vehicle approaches and departs the incident, the curb must be on the left side of the vehicle. A U-turn is prohibited.3: No U-turn. When the vehicle approaches the incident, the curb can be on either side of the vehicle; however, the vehicle must depart without turning around. Learn more about U-turn policies
Show illustration
Setting Coded value Description Either side of vehicle
0
The vehicle can approach and depart the incident in either direction, so a U-turn is allowed at the incident. This setting can be chosen if it is possible and desirable for a vehicle to turn around at the incident. This decision may depend on the width of the road and the amount of traffic or whether the location has a parking lot where vehicles can pull in and turn around.

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 incident, the incident 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 side.

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 incident, the incident 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.

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 incident, the incident 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.

The allowed arrival and departure combinations for the No U-Turn curb approach are shown.
The
Curbattribute 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.Approach 
With right-hand traffic, the curb approach that leaves the vehicle closest to the incident is Right side of vehicle.

With left-hand traffic, the curb approach that leaves the vehicle closest to the incident is Left side of vehicle.
-
Bearingnumber (non-negative)nullable
The direction in which a point is moving. The units are degrees and are measured clockwise from true north.
This attribute is used in conjunction with the
Bearingattribute. 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 attribute 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 solver determine the side of the street that the point is on.Tol -
BearingTolnumber (range: 0 - 180)default:30nullable
The bearing tolerance value creates a range of acceptable bearing values when locating moving points on an edge using the
Bearingattribute.If the
Bearingattribute 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. 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. -
NavLatencynumber (non-negative)nullable
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.
This attribute is only used in the solve process if the
BearingandBearingfields also have values; however, providing aTol Navattribute value is optional, even when values are present in theLatency BearingandBearing.Tol
Example
The example shows how to specify some attributes for the incidents.
{
"spatialReference": {
"wkid": 4326
},
"features": [
{
"geometry": {
"y": 51.5254,
"x": -0.1891
},
"attributes": {
"Name": "Incident 1",
"ID": "C100045",
"AdditionalTime": 5,
"CurbApproach": 0
}
},
{
"geometry": {
"y": 51.5353,
facilities
Specify one or more locations that are searched for when finding the closest location. These locations are referred to as facilities.
When specifying the facilities, you can set attributes for each as follows:
Show attributes for facilities
Attributes for facilities
-
Namestring (length: 500)nullable
The name of the facility. The name is used in the driving directions. If the name is not specified, a unique name prefixed with Location is automatically generated in the output routes and directions.
-
ObjectIDinteger (non-negative)nullable
The object ID of the facility.
Objectis a unique identifier for the facility. If you want to maintain a relationship between input and output, setID preservetoObject ID true, and theObjectvalue of the input facility is included in the output routes (as theID Facilityfield). TheID Objectvalue is also included in the output facilities (as theID Objectfield) and can be used to join additional information from the analysis outputs to the attribute of the facilities. If theID Objectvalue is not specified, a unique ID is automatically generated in the output.ID
-
CurbApproachint enumdefault:0
Allowed values:
0,1,2,3Specifies the direction a vehicle may arrive at and depart from the facility. The field value is specified as one of the following integers:
0: Either side of vehicle. The vehicle can approach and depart the facility in either direction. U-turns are allowed. You should choose this setting if your vehicle can make a U-turn at the order or if it can pull into a driveway or parking lot and turn around.1: Right side of vehicle. When the vehicle approaches and departs the facility, the curb must be on the right side of the vehicle. A U-turn is prohibited.2: Left side of vehicle. When the vehicle approaches and departs the facility, the curb must be on the left side of the vehicle. A U-turn is prohibited.3: No U-turn. When the vehicle approaches the facility, the curb can be on either side of the vehicle; however, the vehicle must depart without turning around. Learn more about U-turn policies
Show illustration
Setting Coded value Description 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 location has a parking lot where vehicles can pull in and turn around.

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

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.

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.

The allowed arrival and departure combinations for the No U-Turn curb approach are shown.
The
Curbattribute 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.Approach 
With right-hand traffic, the curb approach that leaves the vehicle closest to the incident is Right side of vehicle.

With left-hand traffic, the curb approach that leaves the vehicle closest to the incident is Left side of vehicle.
-
Attr_[Cost]number (non-negative)default:0nullable
The name of the attribute can be:
Attr,_Travel Time Attr,_Truck Travel Time Attr,_Minutes Attr,_Truck Minutes Attr,_Walk Time Attr,_Miles Attr_Kilometers This attribute specifies how much additional time spent or distance traveled can occur at the facility. The value for this attribute is included in the total travel time or distance for the output routes and is also displayed in output directionPoints as service time.
The value for this attribute is specified in the units of the cost attribute. For instance,
Attris in minutes._Travel Time Use case
When a time-based cost attribute
Travelis used, it will specify the travel time for cars, in minutes, that will be added to the total travel time of the route between the incident and the closest facility. The attribute value can be used to model the time spent at the incident.Time For example, if you are finding the three closest fire stations from a fire incident, the attribute can store the amount of time spent at the fire incident. This could be the time it takes for firefighters to hook up their equipment and begin fighting the fire. The value for this attribute is included in the total travel time for the route and is also displayed in driving directions as service time.
Attris only referenced if_Travel Time Travelis used in the analysis as impedance or accumulate attribute. A zero or null value indicates that the incident requires no service time.Time However, when a distance-based cost attribute like
Milesis used, it specifies the distance in miles that will be added to the total distance of the route between the incident and the closest facility. Generally the locations of the incidents are not exactly on the streets but are set back somewhat from the road. TheAttrattribute can be used to model the distance between the actual incident location and its location on the street if it is important to include that distance in the total travel distance._Miles Attris only referenced if_Miles Milesis used in the analysis as impedance or accumulate attribute.
-
Cutoff_[Impedance]number (non-negative)default:null
Specify the travel time or distance at which to stop searching for facilities for a given incident.
If
Cutoffis not set for an incident, the service will use the value specified as the_[ Impedance] defaultparameter. The default value for this attribute is null, which causes the service to use the value set for theCutoff defaultparameter. If theCutoff Cutoffattribute is set to a value other than null, the_[ Impedance] defaultvalue is overridden.Cutoff Use case
For example, when a time-based cutoff impedance
Travelis used, it will specify the travel time for cars, in minutes, at which to stop searching for facilities for a given incident. Any incident beyond the cutoff value will not be searched. IfTime Cutoffis not set for an incident, the service will use the value specified as the_Travel Time defaultparameter. The value for theCutoff Cutoffattribute allows the ability to overwrite the_Travel Time defaultvalue on a per facility basis. The default value for this attribute isCutoff null, which indicates not to use any cutoff.However, when a distance-based cutoff impedance like
Milesis used, it will specify the travel distance in miles at which to stop searching for facilities for a given incident. Any incident beyond the cutoff value will not be searched. IfCutoffis not set for a facility, the service will use the value specified as the_Miles defaultparameter. The value for theCutoff Cutoffattribute allows the ability to overwrite the_Miles defaultvalue on a per facility basis. The default value for this attribute isCutoff null, which indicates not to use any cutoff.
-
Bearingnumber (non-negative)nullable
The direction in which a point is moving. The units are degrees and are measured clockwise from true north.
This attribute is used in conjunction with the
Bearingattribute. 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 attribute 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 solver determine the side of the street that the point is on.Tol -
BearingTolnumber (range: 0 - 180)default:30nullable
The bearing tolerance value creates a range of acceptable bearing values when locating moving points on an edge using the
Bearingattribute.If the
Bearingattribute 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. 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. -
NavLatencynumber (non-negative)nullable
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.
This attribute is only used in the solve process if the
BearingandBearingfields also have values; however, providing aTol Navattribute value is optional, even when values are present in theLatency BearingandBearing.Tol
Example
The example shows how to specify some attributes for the facilities.
{
"spatialReference": {
"wkid": 4326
},
"features": [
{
"geometry": {
"y": 51.5254,
"x": -0.1891
},
"attributes": {
"Name": "Facility 1",
"ID": "F100045",
"AdditionalTime": 5,
"CurbApproach": 0
}
},
{
"geometry": {
"y": 51.5353,
returnCFRoutes
Specify whether the service will return routes.
true—Routes are returned. The routes are available in theroutesproperty of the JSON response. The shape of the routes depends on the value for theoutputparameter.Lines false—Routes are not returned.
Optional parameters
travelMode
Choose the mode of transportation for the analysis.
Travel modes are managed and configured in ArcGIS Online by the administrator of your organization to better reflect the organization's workflows.
travelDirection
Allowed values: esri,esri
Specify how the travel direction for the closest facility search will be measured.
This parameter can be specified using the following values:
esri—The direction of travel is from facilities to incidents.NA Travel Direction From Facility esri—The direction of travel is from incidents to facilities.NA Travel Direction To Facility
Each option may find different facilities, as the travel time along some streets may vary based on the travel direction and one-way restrictions. For instance, a facility may be a 10-minute drive from the incident while traveling from the incident to the facility, but while traveling from the facility to the incident, it may be a 15-minute drive because of different travel time in that direction.
Fire departments commonly use the esri value for the parameter since they are concerned with the time it takes to travel from the fire station (facility) to the location of the emergency (incident). A retail store (facility) is more concerned with the time it takes the shoppers (incidents) to reach the store; retail stores commonly use the esri parameter value.
defaultTargetFacilityCount
Specify the number of closest facilities to find per incident.
This is useful in situations in which multiple fire engines may be required from different fire stations, such as a fire. You can specify, for example, to find the three nearest fire stations to a fire. The value for this parameter can be overridden on a per-incident basis by specifying a value for the Target attribute when specifying the incidents parameter.
defaultCutoff
type:double (non-negative)
The travel time or travel distance value at which to stop searching for facilities for a given incident.
For example, while finding the closest hospitals from the site of an accident, a cutoff value of 15 minutes means that the tool will search for the closest hospital within 15 minutes from the incident. If the closest hospital is 17 minutes away, no routes will be returned in the output routes. A cutoff value is especially useful when searching for multiple facilities.
The unit for this parameter is based on the unit of the impedance attribute specified using the impedance parameter or the impedance value of the travel mode if a travel mode is specified . If the impedance parameter is Travel, the default value is specified in minutes. Otherwise, the value is specified in miles or kilometers based on whether the impedance parameter is set to Miles or Kilometers, respectively.
The value for the default parameter can be overridden on a per-incident or facility basis by specifying a value for the Cutoff attribute when specifying the incidents or the facilities parameter values.
timeOfDay
Specify the time and date to depart from or arrive at incidents or facilities. You can also specify a value of now, to set the depart or arrive time to current time.
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, set impedance to Travel, and assign a time value.
The time value represents the target start time or arrive time of the routes in the analysis. The time is specified as Unix time (milliseconds since midnight, January 1, 1970).
If a value of now is passed to the time parameter, the travel begins at the current time. This will also override the time parameter value to be true. When time is now and time is true, the travel will begin or end at input locations at the current time regardless of the time zone of the input locations.
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.
If the time 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 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.
The service support two kinds of traffic: live and typical.
Typical traffic
To ensure the task uses typical traffic in locations where it is available, choose a time and day of the week, and then convert the day of the week to one of the following dates from 1990:
- Monday—1/1/1990
- Tuesday—1/2/1990
- Wednesday—1/3/1990
- Thursday—1/4/1990
- Friday—1/5/1990
- Saturday—1/6/1990
- Sunday—1/7/1990
Set the time and date as Unix time in milliseconds. For example, to solve for 1:03 p.m. on Thursdays, set the time and date to 1:03 p.m., 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.
All facilities and incidents must be in the same time zone when you are doing any of the following:
- Specifying a start time and traveling from incident to facility
- Specifying an end time and traveling from facility to incident
- Specifying a start time and traveling from facility to incident
- Specifying an end time and traveling from incident to facility
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.
Show examples
Typical traffic on Thursdays
13:03, January 4, 1990. Typical traffic on Thursdays at 1:03 p.m.
{ "timeOfDay": 631458180000 }timeOfDayIsUTC
Specify the time zone or zones of the time parameter.
-
false—Thetimevalue 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.Of Day Illustration of setting the value to
false(use geographically Local time zone)Setting
timeto 9:00 a.m., January 4, 1990 (631443600000 milliseconds);Of Day timetoOf Day Is UTC false; 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.)
Input: startis 9:00 a.m., January 4, 1990 (631443600000 milliseconds), andTime startis set toTime Is UTC false -
true—Thetimevalue refers to coordinated universal time (UTC). The start times for all points are simultaneous, regardless of time zones.Of Day Illustration of setting the value to
true(use UTC)Setting
timeto 9:00 a.m., January 4, 1990 (631443600000 milliseconds);Of Day timetoOf Day Is UTC true, 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.
Input: startis 9:00 a.m., January 4, 1990 (631443600000 milliseconds), andTime startis set toTime Is UTC true
timeOfDayUsage
Allowed values: esri, esri
The time parameter value represents the arrival or departure time for the routes. This parameter can be specified using the following values:
esri—The service finds the best route considering theNA Time Of Day Use As Start Time timeparameter value as the departure time from the facility or incident.Of Day esri—The service considers theNA Time Of Day Use As End Time timeparameter value as the arrival time at the facility or incident. This value is useful if you want to know what time to depart from a location so that you arrive at the destination at the time specified inOf Day time.Of Day
The parameter value is ignored if the time parameter value is none.
useHierarchy
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