Exercise 5: Calculating service areas and creating an OD cost matrix

Complexity: Beginner Data Requirement: ArcGIS Tutorial Data Setup Data Path: C:\ArcGIS\ArcTutor\Network Analyst\Tutorial Goal: Create service area polygons and create an OD cost matrix.

In this exercise, you will create a series of polygons that represent the distance that can be reached from a facility within a specified amount of time. These polygons are known as service area polygons. You will calculate 3-, 5-, and 10-minute service areas for six warehouses in Paris.

You will also find how many stores are within each of these service areas. You will identify one warehouse that should be relocated to better service the stores. Additionally, you will create an origin–destination cost matrix for delivery of goods from the warehouses to all stores within a 10-minute drive time. Such a matrix is used as an input for logistics, delivery, and routing analyses.

Steps:
1. If you have Exercise05.mxd open in ArcMap, skip to step 6.
2. Start ArcMap by clicking Start > All Programs > ArcGIS > ArcMap 10.
3. On the ArcMap - Getting Started dialog box, click Existing Maps > Browse for more.
4. Browse to C:\ArcGIS\ArcTutor\Network Analyst\Tutorial.

This is the default installation location for the tutorial data.

5. Double-click Exercise05.mxd.

The map document opens in ArcMap.

6. Enable the Network Analyst extension.
1. Click Customize > Extensions.

The Extensions dialog box opens.

2. Check Network Analyst.
3. Click Close.
7. If the Network Analyst toolbar is not displayed, you need to add it.

8. Click Customize > Toolbars > Network Analyst.

The Network Analyst toolbar is added to ArcMap.

9. If the Network Analyst window is not displayed, you need to add it.

10. On the Network Analyst toolbar, click the Show/Hide Network Analyst Window button .

The dockable Network Analyst window opens.

11. You can dock or undock the Network Analyst window. In this exercise, it is docked below the Table Of Contents window.

Creating the service area analysis layer

Steps:
1. Click Network Analyst on the Network Analyst toolbar and click New Service Area.

The service area analysis layer is added to the Network Analyst window. The network analysis classes (Facilities, Polygons, Lines, Point Barriers, Line Barriers, and Polygon Barriers) are empty.

Next, you will add warehouses as facilities for which the service area polygons will be generated.

Steps:
1. On the Network Analyst window, right-click Facilities (0) and choose Load Locations.

The Load Locations dialog box opens.

2. In the Load From drop-down list, choose Warehouses.

3. Click OK.

The six facilities are displayed in the map.

4. In the Network Analyst window, click the plus (+) sign next to Facilities (6) to see a list of the loaded facilities.

Setting up the parameters for the analysis

Next, you will specify that your service area will be calculated based on drive time (using minutes). Three service area polygons will be calculated for each facility, one at 3 minutes, one at 5 minutes, and another at 10 minutes. You will specify that the direction of travel will be from the facility—not toward the facility, that no U-turns are allowed, and that one-way restrictions must be followed.

Steps:
1. Click the Analysis Layer Properties button on the Network Analyst window.

The Layer Properties dialog box opens.

2. Click the Analysis Settings tab.
3. Make sure that Impedance is set to use DriveTime (Minutes).
4. Type 3 5 10 in the Default Breaks text box.
5. Under Direction, click Away From Facility.
6. Choose Not Allowed from the U-Turns at Junctions drop-down list.
7. Leave Ignore Invalid Locations checked.
8. Check Oneway in the Restrictions list.
9. The Analysis Settings tab should now look like this:
10. Click the Polygon Generation tab.
11. Make sure that Generate Polygons is checked.
12. For Polygon Type, click Generalized.

Detailed polygons are more accurate but need more time to be generated.

13. Uncheck the Trim Polygon option.

This is a postprocess that trims the outside polygon to remove spikes but takes a little longer to run.

14. Click Overlapping for the Multiple Facilities Options.

This results in individual polygons for each facility. A polygon from one facility might overlap with a polygon from another, nearby facility.

15. Click Rings for the Overlap type.

This excludes areas of smaller breaks from the polygons of a bigger break.

16. Click Apply to save the settings.
17. Click the Line Generation tab.
18. Leave Generate Lines unchecked.
19. Click OK.

Run the process to compute the service area

Steps:
1. Click the Solve button on the Network Analyst toolbar.

The service area polygons appear on the map and on the Network Analyst window.

2. The polygons are transparent, which allow you to see the underlying streets. However, instead of color coding the breaks from dark to light with increasing distance, you will change them to go from light to dark.
4. Click the Symbology tab.
5. Click the Symbol field name and choose Flip Symbols. (Make sure you click—not right-click—Symbol; otherwise, you get a different context menu.)

6. Click OK.

The outer and inner service area breaks switch colors, making it clearer what areas the 10-minute breaks cover.

Identifying stores that are outside all service areas

Steps:
1. In the Table Of Contents window, click and drag Stores to the top of the Layers list to improve visibility.

2. Click Selection > Select By Location.

3. Create the selection query on the Select By Location dialog box to select features from stores that are completely within polygons, as shown below.

4. Click OK.

The stores that are within the polygons are selected; however, you want to select the stores that are outside the service area polygons.

The selection now shows the distribution of stores not contained in any service area polygons. Use this selection to identify the area in which you will relocate a warehouse. The best area appears to be in the center of the map.

6. On the Tools toolbar, click the Clear Selected Features button .

Relocating the least accessible warehouse

Look at the service area polygons of Warehouse #2. There are not any stores within the 3-, 5-, or 10-minute service areas around Warehouse #2; hence, you will relocate that warehouse to better service the stores.

Steps:
1. On the Network Analyst window, select Warehouse #2 under Facilities (6).

2. Click the Select/Move Network Location Tool on the Network Analyst toolbar.
3. On the map display, drag Warehouse #2 to the center of the map as shown below.

Run the process to compute the service area

Steps:
1. Click the Solve button on the Network Analyst toolbar.

The service area polygons appear on the map and the Network Analyst window.

Identifying the service area polygon that each store is within

Steps:

The Join Data dialog box opens.

2. Choose Join data from another layer based on spatial location.

3. Choose Polygons as the layer to join to this layer.

4. Click the it falls inside button.

This adds the attributes of the polygon to all points that fall inside the polygon.

5. Specify an output shapefile or feature class to save the join results to and name it StoresWithPoly.

6. Click OK.

ArcGIS performs the join and adds the new layer to the map document.

7. In the Table Of Contents window, right-click the new StoresWithPoly feature layer and choose Open Attribute Table.

Each row in the table displays the name of the store and polygon it falls under. You can use this table to generate other useful categories, such as the number of stores within 0-to 3-minute service areas.

8. Close the attribute table.
9. You can optionally export your facilities (including the one you moved) as a feature class.
10. In the Network Analyst window, right-click Facilities (6) and choose Export Data.

The Export Data dialog box opens.

11. In the Export drop-down list, choose All features.
12. Choose an output location and type (shapefile or feature class).

You might choose to store a feature class in the Paris geodatabase: C:\arcgis\ArcTutor\Network Analyst\Tutorial\Paris.gdb\New_Warehouses

13. Click OK.

A message appears asking if you want to add the exported data to the map.

14. Click No.

You won't need the data for the rest of this exercise.

Creating an OD cost matrix analysis layer

Optionally, you can create an origin–destination cost matrix for deliveries from the new warehouses to each store. The results of this matrix can be used to identify stores that will be serviced by each warehouse within a 10-minute drive time. Also, you can find the total drive time from each warehouse to its stores.

Steps:
1. In the Table Of Contents window, uncheck the Service Area analysis layer and the StoresWithPoly feature layer to improve readability of the map.
2. Click Network Analyst on the Network Analyst toolbar and click New OD Cost Matrix.

The OD cost matrix analysis layer is added to the Network Analyst window. The network analysis classes (Origins, Destinations, Lines, Point Barriers, Line Barriers, and Polygon Barriers) are empty.

You can use the facilities from the service area analysis (in the previous sections) as origins. If you have not completed the section on service areas, you can use the Warehouses feature layer instead.

Steps:
1. In the Network Analyst window, right-click Origins (0) and choose Load Locations.

The Load Locations dialog box opens.

2. Click ServiceArea/Facilities in the Load From drop-down list. (If you did not complete the previous sections on service area analysis, you can choose Warehouses instead.)
3. Uncheck Only load selected rows.
4. Under Location Position, click Use Network Location Fields. (If you are loading Warehouses, click Use Geometry.)

Using network location fields allows ArcGIS to use the already-located position of service area facilities to locate them again as origins. This is much faster than using a spatial search to locate them again.

5. Click OK.

The six new origins are displayed on the map and listed in the Network Analyst window under Origins.

Steps:
1. In the Network Analyst window, right-click Destinations (0) and choose Load Locations.
2. Choose Stores in the Load From drop-down list.
3. Under Location Analysis Properties, for the property name, choose NOM from the Field drop-down list.

Since the French field name NOM is not configured in the NASolverConfiguration.xml file, ArcGIS is unable to map the field name automatically.

4. Click OK.

The Network Analyst window now lists 21 destinations.

These destinations are also displayed on the map.

Setting up the parameters for the analysis

Next, you will specify that your OD cost matrix will be calculated based on drive time. You will set a default cutoff value of 10 minutes and ensure that all destinations are found within the specified cutoff. Additionally, you will specify that U-turns are allowed everywhere and the output Shape type should be a straight line. Since all these trips are on roads, one-way restrictions must be followed. All invalid locations (locations not found) will be ignored.

Steps:
1. Click the Analysis Layer Properties button on the Network Analyst window.

2. Click the Analysis Settings tab.
3. Make sure that the Impedance drop-down list is set to DriveTime (Minutes).
4. Type 10 in the Default Cutoff Value text box.

This will create origin–destination paths from each warehouse to all stores that can be reached within 10 minutes.

5. Make sure that Destinations To Find is set to <All>.
6. Click the U-Turns at Junctions drop-down arrow and choose Allowed.
7. Make sure that Output Shape Type is set to Straight Line.
8. Make sure that Ignore Invalid Locations is checked.
9. Check Oneway in the Restrictions list.

10. Click OK.

The parameter settings are saved.

Run the process to create the OD cost matrix

Steps:
1. Click the Solve button on the Network Analyst toolbar.

The OD lines appear on the map. There are 24 lines in this example. This number may be different for you, depending on where you relocated Warehouse #2.

2. If the Service Area layer is not displayed, turn it on to show the OD Cost Matrix layer on top of the service areas of the warehouses.

Allocating stores to warehouses

Based on the OD cost matrix, you can now identify the stores that would be served by each warehouse.

Steps:
1. In the Network Analyst window, right-click Lines (24) and choose Open Attribute Table.

The Lines table opens.

2. The Lines table represents the origin–destination cost matrix from each warehouse to the stores within a 10-minute drive time. The OriginID column contains IDs of warehouses. The DestinationID column contains IDs of stores. The DestinationRank is a rank assigned to each destination that is served by a store based on the total drive time. For example, in the table below, for Warehouse #1, DestinationID 2 has a rank of 1, and DestinationID 3 has a rank of 2. This is because it takes less time to go from Warehouse #1 to DestinationID 2. (This may be different for you, as your analysis results are dependent on the source feature class of the origins and destinations.)

The OD cost matrix displays the stores serviced by each warehouse along with the total drive time for each route. Some stores are within a 10-minute accessibility zone of more than one warehouse and can be served by any one of them. The OD cost matrix can also be used as an input in logistics routing models that use origin–destination matrices to allocate goods and services.

3. If you don't plan to work on any other exercise, exit ArcMap. Click No to discard any changes.
4. If you plan to work on another exercise, follow the substeps below.
1. Click File > New.

The New Document dialog box opens.

2. Click OK.
3. Click No when prompted to save changes.

2/2/2012