Available with Network Analyst license.
The closest facility solver measures the cost of traveling between incidents and facilities and determines which are nearest to one another. When finding closest facilities, you can specify how many to find and whether the direction of travel is toward or away from them. The closest facility solver displays the best routes between incidents and facilities, reports their travel costs, and returns driving directions.
When finding the closest facility, you can specify constraints, like a cutoff cost beyond which Network Analyst will not search for facilities. For instance, you can set up a closest facility problem to search for hospitals within a 15-minute drive of the site of an accident. Any hospitals that take longer than 15 minutes to reach are not included in the results. In this example, the hospitals are facilities, and the accident is the incident. Network Analyst allows performing multiple closest facility analyses simultaneously. This means you can have multiple incidents and find the closest facility (or facilities) for each incident.
Finding the closest facility to an incident follows the same workflow as other network analyses.
Learn more about the network analysis workflow
Closest facility analysis layer
The closest facility analysis layer stores all the inputs, parameters, and results of a closest facility analysis.
Creating a closest facility analysis layer
You can create a closest facility analysis layer from the Network Analyst toolbar by clicking Network Analyst > New Closest Facility.
When you create a new closest facility analysis layer, it appears in the Network Analyst window, along with its six network analysis classes: Facilities, Incidents, Routes, Point Barriers, Line Barriers, and Polygon Barriers.
The closest facility analysis layer also appears in the Table of Contents window as a composite layer named Closest Facility. If a closest facility with the same name already exists in the map document, a number is added to the name such as Closest Facility 1, Closest Facility 2, and so on. There are six feature layers: Facilities, Incidents, Routes, Point Barriers, Line Barriers, and Polygon Barriers. Each of the six feature layers has default symbology that can be modified on its Layer Properties dialog box.
Closest facility analysis classes
The closest facility analysis layer is composed of six network analysis classes.
Learn more about network analysis classes
An overview of each class and descriptions of their properties are provided in the following sections.
Facilities class
This network analysis class stores the network locations that are used as the starting or ending points in closest facility analyses.
When a new closest facility analysis layer is created, the Facilities class is empty. It is populated only when network locations are added into it. A minimum of one facility and one incident are necessary to solve the analysis.
Facility properties
Input properties of facilities
Input field | Description |
---|---|
ObjectID | The system-managed ID field. |
Shape | The geometry field indicating the geographic location of the network analysis object. |
Name | The name of the network analysis object. |
Attr_[Cost] (for instance, Attr_Minutes, where Minutes is a cost attribute on the network) | This property stores the value of impedance for the network location. Take the example of finding the three closest fire stations to a fire incident using DriveTime as the impedance. Attr_DriveTime can store the turnout time for the facility. Turnout time is how long it takes a crew to don the appropriate protective equipment and exit the fire station. |
Cutoff_[Impedance] (for instance, Cutoff_DriveTime, where DriveTime is the impedance for the network) | While searching for the closest incident from a facility, Network Analyst can use a cutoff value for the impedance. Any incident beyond the cutoff value will not be searched. If Cutoff_[Impedance] is not set for a facility, the closest facility analysis will use the Default Cutoff Value, which you specify in the analysis settings on the Layer Properties dialog box. If Default Cutoff Value is set to <None>, the closest incident will be found, regardless of how far it may be. |
Network location fields
| Together, these four properties describe the point on the network where the object is located. |
CurbApproach | This property lets you specify which side of the vehicle you want the facility to be on when the vehicle arrives or departs. You can use the Right side of vehicle (1) or Left side of vehicle (2) values for any analysis that requires the vehicle to arrive or depart a facility from one side only. If the arrival or departure is permitted from either side of a vehicle, use the default value Either side of vehicle (0). For closest facility analyses, the No U-turn (3) value functions in the same way as Either side of vehicle. |
Input/Output fields of facilities
Input/output field | Description |
---|---|
Status | This field is constrained by a domain of values, which are listed below (their coded values are shown in parentheses).
After a solve operation, the status can be modified using one of the following status values:
|
Incidents class
This network analysis class stores the network locations that are used as starting or ending points in closest facility analyses. Whether starting or ending points, incidents are always on the opposite end of a route from the connected facility.
When a new closest facility analysis layer is created, the Incidents class is empty. It is populated only when network locations are added into it. A minimum of one facility and one incident are necessary to solve the analysis.
Incident properties
Input fields of incidents
Input field | Description |
---|---|
ObjectID | The system-managed ID field. |
Shape | The geometry field indicating the geographic location of the network analysis object. |
Name | The name of the network analysis object. |
TargetFacilityCount | This property stores the number of facilities that need to be found for the incident. If this property is set to a value other than <Null>, the number of facilities to find for the analysis layer is overridden. The analysis layer property it overrides is Facilities To Find, which is found on the Analysis Settings tab of the Layer Properties dialog box. |
Attr_[Cost] (for instance, Attr_Minutes, where Minutes is a cost attribute on the network) | This property stores the value of impedance for the network location. For example, if you're finding the three closest fire stations from a fire incident using DriveTime as impedance, the property Attr_DriveTime 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. |
Cutoff_[Impedance] (for instance, Cutoff_DriveTime, where DriveTime is the impedance for the network) | While searching for the closest facility from an incident, you can enter an impedance value. Any incident beyond the cutoff value will not be searched or included in the results. If Cutoff_[Impedance] is not set for a facility, the closest facility analysis will use the default cutoff value set on the Analysis Settings tab of the Layer Properties dialog box. If the default cutoff value is also not set, the closest incident will be found, regardless of how far it may be. |
Network location fields
| Together, these four properties describe the point on the network where the object is located. |
CurbApproach | This property lets you specify which side of the vehicle you want the incident to be on when the vehicle arrives or departs. You can use the Right side of vehicle (1) or Left side of vehicle (2) value for any analysis that requires the vehicle to arrive or depart an incident from one side only. If the arrival or departure is permitted from either side of a vehicle, use the default value Either side of vehicle (0). For closest facility analyses, the No U-turn (3) value functions in the same way as Either side of vehicle. |
Input/Output fields of incidents
Input/Output field | Description |
---|---|
Status | This field is constrained by a domain of values, which are listed below (their coded values are shown in parentheses).
After a solve operation, the status can be modified using one of the following status values:
|
Routes class
The Routes class stores the resulting route, or routes, of the analysis. As with other feature layers, its symbology can be accessed and altered from its Layer Properties dialog box.
The Route class is an output-only class; it's empty until the analysis is complete. Once the closest facilities are found, the routes are displayed on the Network Analyst window.
Route properties
Output fields of routes
Output field | Description |
---|---|
ObjectID | The system-managed ID field. |
Shape | The geometry field indicating the geographic location of the network analysis object. |
Name | The name of the closest facility route is based on the names of the associated facility and incident. The facility name is first if Facility to Incident is the selected Travel From analysis layer setting. For example, Facility 5–Incident 3 indicates the route travels from Facility 5 to Incident 3. If Incident to Facility is selected, the incident name is first; for instance, Incident 3–Facility 5. |
FacilityID | The unique ID of the facility the route visits. |
FacilityRank | The rank of the facility among all facilities found for the associated incident; the closest facility has a rank of 1. |
IncidentCurbApproach | Describes the side of the vehicle the incident is on when arriving at or departing from the incident. A value of 1 means the right side of the vehicle; a value of 2 indicates the left side. |
FacilityCurbApproach | Describes the side of the vehicle the facility is on when arriving at or departing from the facility. A value of 1 means the right side of vehicle; 2 indicates the left side. |
IncidentID | The unique ID of the incident the route visits. |
Total_[Impedance] (for instance, Total_Minutes, where Minutes is the impedance for the network) | The cumulative cost of the route between the facility and the incident. This field is generated for the impedance attribute and any accumulation attributes. |
StartTime | The start time of the route, reported as local time at the first stop. |
EndTime | The end time of the route, reported as local time at the last stop. |
StartTimeUTC | The start time of the route in Coordinated Universal Time (UTC). |
EndTimeUTC | The end time of the route in Coordinated Universal Time (UTC). |
Point, line, and polygon barriers
Barriers serve to temporarily restrict, add impedance to, and scale impedance on parts of the network. When a new network analysis layer is created, the barrier classes are empty. They are populated only when you add objects into them—but adding barriers is not required.
Barriers are available in all network analysis layers; therefore, they are described in a separate topic.
Closest facility analysis parameters
Analysis parameters are set on the Layer Properties dialog box for the analysis layer. The dialog box can be accessed in different ways:
Learn more about opening the network analysis Layer Properties dialog box
Analysis Settings tab
The following subsections list parameters that you can set on the analysis layer. They are found on the Analysis Settings tab of the analysis layer's Layer Properties dialog box.
Impedance
Any cost attribute can be chosen as the impedance, which is minimized while determining the route. For instance, choosing the Minutes attribute results in the quickest route to the closest facility.
By choosing a traffic-enabled cost attribute and specifying a time of day and date under Use Time, the closest facility analysis accounts for variable traffic speeds for that time and date.
Restrictions
You can choose which restriction attributes should be respected while solving the analysis. In most cases, restrictions cause roads to be prohibited, but they can also cause them to be avoided or preferred. A restriction attribute, such as Oneway, should be used when finding solutions for vehicles that must obey one-way streets (for instance, nonemergency vehicles). Other common restriction attributes include height or weight limits that prohibit some vehicles from traversing certain roads or bridges; hazardous materials restrictions that hazmat drivers need to completely bypass or at least try to avoid; and designated truck routes that truck drivers should try to follow. You can choose which restriction attributes should be respected while solving the analysis. (You can further specify whether the elements that use the restriction should be prohibited, avoided, or preferred in the Attribute Parameters tab.)
Use Time
Use Start Time, in conjunction with the Usage, Time of Day, and Day of Week or Specific Date properties, lets you specify when the routes start or end.
Note that specifying a start time doesn't require a traffic-enabled cost attribute; yet, if the network dataset includes traffic data, the results of the analysis are more accurate. That is, the results are calculated for the time and date that you set. For example, during rush hour, the routes could take longer than during off-peak hours. Furthermore, the best paths could change depending on traffic conditions at that time.
Usage
The time and date you enter can represent the moment you want the closest facility routes to start or finish. Choose either Start time or End time accordingly.
Time of Day
The value you enter here represents the time of day that the closest facility routes will start or end.
The time you specify in Time of Day must be associated with a date. You can choose between entering a calendar date (Specific Date) or a floating day (Day of Week).
Specific Date
For a calendar date, you provide the day, month, and year that the Time of Day value is associated with.
Day of Week
For a floating day, you can choose Today or any day of the week (Sunday through Saturday) relative to the current date. Floating days enable you to configure an analysis layer that can be reused, without having to remember to change the date.
You can solve up to six days ahead relative to the current date when choosing Day of Week.
Using a start time with traffic data and time zones
If you use a time-based impedance attribute or accumulate attribute, the time and date you specify in Use Time refers to the time zone of the edge or junction on which the facility or incident is located.
A few requirements to be aware of when routing across multiple time zones are listed below.
- All incidents must be in the same time zone when:
- Specifying a start time and traveling from incident to facility
- Specifying an end time and traveling from facility to incident
- All facilities must be in the same time zone when:
- Specifying a start time and traveling from facility to incident
- Specifying an end time and traveling from incident to facility
Default Cutoff Value
While searching for the closest facility, Network Analyst can use a default cutoff value of impedance. Any facility beyond the cutoff value will not be searched. For instance, while locating the closest hospitals from the site of an accident, a cutoff value of 15 minutes would mean that Network Analyst would search for the closest hospital within 15 minutes from the incident. If the closest hospital is 17 minutes away, no hospitals will be returned in the closest facility search. A cutoff value is especially useful when searching for multiple facilities.
Individual facilities and incidents can have their own cutoff values that override this Default Cutoff Value. When traveling from incidents to facilities, a value in the cutoff property of an incident overrides the default. When traveling from facilities to incidents, a value in the cutoff property of a facility overrides the default.
Facilities To Find
Network Analyst can find multiple closest facilities from an incident. This is useful in situations, such as a fire, where multiple fire engines may be required from different fire stations. Network Analyst can find, for example, the nearest three fire stations to a fire. If you were to use a cutoff cost of 10 minutes, and the three closest stations were at 5, 7, and 11 minutes, only the first two stations would be returned by the closest facility search.
If any incidents have a value other than null for the TargetFacilityCount property, Facilities To Find will be overridden.
Travel From
You can specify whether you want to search for the closest facility as measured from the incident to the facility or from the facility to the incident. Restrictions, such as Oneway, and impedances, such as TravelTime, can be based on direction of travel, which can affect the results. For instance, a 10-minute drive may be required when traveling from the incident to the facility, but a 15-minute drive may be required when traveling in the opposite direction.
You may want to choose Incident to Facility to model a person finding the closest hospital. Similarly, Facility to Incident might model a fire truck responding from a fire station to an emergency since this is the critical part of the trip.
U-turns at Junctions
Network Analyst can allow U-turns everywhere, nowhere, only at dead ends (or culs-de-sac), or only at intersections and dead ends. Allowing U-turns implies the vehicle can turn around at a junction and double back on the same street.
Output Shape Type
The resulting routes of a closest facility analysis can be represented by the true shape with measures, true shape, straight lines, or none (no geometry).
- True Shape gives the exact shape of the resulting route.
- True Shape with Measures gives the exact shape of the resulting route. Furthermore, the output includes route measurements for linear referencing. The measurements increase from the first stop and record the cumulative impedance.
- Straight Line results in a single, straight line between the stops.
- When the output shape type is set to None, no shape is returned.
Use Hierarchy
If the network dataset has a hierarchy attribute, you can use the hierarchy during the analysis. Using a hierarchy results in the solver preferring higher-order edges to lower-order edges. Hierarchical solves are faster, and they can be used to simulate the driver preference of traveling on freeways instead of local roads—even if that means a longer trip. Not using a hierarchy, however, yields an exact route for the network dataset.
Ignore Invalid Locations
This property allows you to ignore invalid network locations and solve the analysis layer from valid network locations only. If this option is not checked and you have unlocated network locations, the solve may fail. In either case, the invalid locations are ignored in the analysis.
Directions
With the Directions properties, you can set the units for displaying distance and, optionally, time (if you have a time attribute). Additionally, you can choose to open directions automatically after the generation of a route. (If you choose not to display directions automatically, you can click the Directions Window button on the Network Analyst toolbar to display directions.)
Accumulation tab
Under the Accumulation tab, you can choose cost attributes from the network dataset to be accumulated on the route objects. These accumulation attributes are purely for reference; the solver only uses the cost attribute specified by the analysis layer's Impedance parameter to calculate the route.
For each cost attribute that is accumulated, a Total_[Impedance] property is added to the routes that are output by the solver, where [Impedance] is replaced with the name of the accumulated impedance attribute.
Assume you set the impedance attribute to Minutes because you want to find a route that minimizes travel time. Even though you're solving using travel time, you would also like to know the length of the quickest route. Suppose you have another cost attribute, Miles, that you check on in the Accumulation tab. After solving, the output route features will have properties named Total_Minutes and Total_Miles.
Conversely, you can find the shortest route and accumulate travel time to determine when the route will arrive at its stops and how long it will take to complete the trip. If you have a traffic-enabled network dataset, you can even find this information for a specific time of day and account for variable traffic speeds. To do this, choose a distance-based cost attribute for the impedance of the analysis layer, use a start time, and accumulate a time-dependent cost attribute.
The Network Locations tab
The parameters on the Network Locations tab are used to find network locations and set values for their properties.