Exercise 3: Finding the best route using a network dataset

Complexity: Beginner Data Requirement: ArcGIS Tutorial Data for Desktop Data Path: C:\ArcGIS\ArcTutor\Network Analyst\Tutorial Goal: Find the quickest route (shortest path) between stops.

In this exercise, you will find the quickest route to visit a set of stops in a predetermined order.

NoteNote:

The data for this exercise and the other exercises in the Network Analyst tutorial is available on ArcGIS.com. After downloading the data, you can extract it wherever you like. It may be helpful, however, to extract it to C:\arcgis\ArcTutor since the tutorial refers to this path as the default location for the data.

Preparing your display

Steps:
  1. If you have Exercise03.mxd open in ArcMap, skip to step 6.
  2. Start ArcMap by clicking Start > All Programs > ArcGIS > ArcMap 10.2.2.
  3. On the ArcMap - Getting Started dialog box, click Existing Maps > Browse for more.

    The Open ArcMap Document dialog box appears.

  4. Browse to C:\ArcGIS\ArcTutor\Network Analyst\Tutorial.

    This is the default installation location for the tutorial data.

  5. Double-click Exercise03.mxd.

    The map document opens in ArcMap.

  6. Enable the ArcGIS 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.

    The Network Analyst toolbar

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

  10. On the Network Analyst toolbar, click the Network Analyst window button Network Analyst window.

    The dockable Network Analyst window opens.

    The Network Analyst window

  11. You can dock or undock the Network Analyst window.

Creating a route analysis layer

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

    Choosing New Route on the Network Analyst toolbar

    The route analysis layer is added to the Network Analyst window. The network analysis classes (Stops, Routes, Point Barriers, Line Barriers, and Polygon Barriers) are empty.

    The Network Analyst window with empty classes

    The analysis layer is also added to the Table Of Contents window.

    The route analysis layer shown in the table of contents

Adding a stop

Next, you will add the stops to be visited by a route.

Steps:
  1. In the Network Analyst window, click Stops (0).

    Stops is selected, which means it is the active network analysis class.

  2. On the Network Analyst toolbar, click the Create Network Location Tool Create Network Location Tool.

    By clicking on the map with the Create Network Location Tool, you can add network analysis objects to the active network analysis class.

  3. Click anywhere on the street network to define a new stop location.
    A new stop shown on the map display

    Network Analyst calculates the nearest network location and symbolizes the stop with the Located symbol. The stop remains selected until another stop is placed or you clear the selection.

    The located stop also displays the number 1. All stops have a unique number, which represents the order in which the stop will be visited by the route. Also notice that the Stops class in the Network Analyst window now lists one stop.

    Stop 1 in the Network Analyst window.

  4. Add two more stops anywhere on or near the streets.
    Three stops shown on the map display

    The new stops are numbered 2 and 3.

  5. The first stop is treated as the origin, and the last as the destination.

    The three stops shown in the Network Analyst window

    The sequence of the stops can be changed by clicking a stop in the Network Analyst window and dragging it to another position in the list.

    If a stop is not located on the network, it appears with an unlocated symbol. (However, using the default settings, you would need to place a stop more than 5 kilometers from the nearest street segment for it to not locate.)

    An example of an unlocated stop

    You can move an unlocated stop closer to the network to locate it. If a stop is located on the network but in the wrong location, you can move the stop to the correct position.

  6. To move a stop, follow these substeps:
    1. Click the Select/Move Network Locations Tool Select/Move Network Locations Tool on the Network Analyst toolbar.
    2. Click a stop to select it.
    3. Click the stop again and drag it to a new location.

      Moving a stop

Setting up the parameters for the analysis

Next, you will specify that your route will be calculated based on travel time (minutes), that U-turns are allowed anywhere, and that one-way and turn restrictions must be followed.

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

    Clicking the Layer Properties button

    The Layer Properties dialog box opens.

  2. Click the Analysis Settings tab.
  3. Make sure that Impedance is set to TravelTime (Minutes).
  4. This network dataset has historical traffic data associated with the TravelTime (Minutes) attribute. If you choose to enter a start time by checking Use Start Time and filling out the three fields below it, Network Analyst will find the quickest route based on that time of day and historical traffic speeds. Alternatively, it will find the quickest route based on a function of street lengths and speed limits.

  5. Check Use Start Time, enter a specific time and date or day of the week.
    1. For Time of Day, enter the time you want to leave the first stop.
    2. Click either Day of Week or Specific Date.

      If you choose Day of Week, specify any day between Sunday and Saturday; optionally, choose Today to use your system's current day setting.

      If you choose Specific Date, either type a date in the text box or click the down-arrow to open a calendar that allows you to choose a date.

  6. Leave Use Time Windows unchecked.

    You can specify time windows for stops and have Network Analyst try to find a route that honors those time ranges in which a stop should be visited.

  7. Leave Reorder Stops To Find Optimal Route unchecked.

    By leaving this property unchecked, Network Analyst discovers the best route given the stop sequence you specify. This is commonly known as the traveling salesman problem (TSP). If checked, it finds the best route and best sequence to visit the stops.

  8. Click the U-Turns at Junctions drop-down arrow and choose Allowed.
  9. Click the Output Shape Type drop-down arrow and choose True Shape with Measures.
  10. Make sure that the Use Hierarchy and Ignore Invalid Locations boxes are checked.
  11. In the Restrictions frame, make sure that RestrictedTurns and Oneway are checked.
  12. In the Directions frame, make sure that Distance Units is set to Miles, Use Time Attribute is checked, and the time attribute is set to TravelTime (Minutes).
  13. The Analysis Settings tab should look like the following graphic; however, your Use Start Time properties may be different:

    Properties in the Analysis Settings tab

  14. Click OK.

Computing the best route

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

    A route feature appears in the map display and in the Network Analyst window under the Routes class.

    A route solution in the map display

  2. If a warning message appears, a stop may be located on a restricted edge. Try moving one or more stops using the Select/Move Network Locations Tool Select/Move Network Locations Tool, which is on the Network Analyst toolbar.
  3. Click the Directions Window button Directions on the Network Analyst toolbar.

    The Directions dialog box opens.

  4. On the rightmost column of the Directions dialog box, click one of the links named Map.

    An inset map of the maneuver is displayed.

    The Directions window displaying an inset map of a maneuver

  5. Click Close.

Adding a barrier

In this section, you will add a barrier on the route to represent a roadblock, and you will find an alternate route to your destination.

Steps:
  1. Click Windows > Magnifier.

    The Magnifier window opens.

  2. Click the title bar of the Magnifier window and drag the window to reposition it over the route.

    The Magnifier window positioned over the route

  3. In the Network Analyst window under Point Barriers (0), click Restriction (0) .
  4. Click the Create Network Location Tool Create Network Location Tool on the Network Analyst toolbar.
  5. In the Magnifier window, click anywhere on the route to place one or more barriers.
    TipTip:

    To see where a barrier will be placed, hold down the 1 key before clicking on the map with the Create Network Location Tool.

    A barrier located on the route

  6. Click the Solve button Solve on the Network Analyst toolbar.

    A new, alternative route is computed that avoids the barrier.

    A new route shown in the map display and Magnifier window

  7. Close the Magnifier window.

Saving the route

The route analysis layer is currently stored in memory, so if you exit ArcMap without saving, the analysis is lost. However, if you save the map document, the analysis layer is saved with it. You can also export data. One option is to export the entire analysis layer to an LYR file. The analysis properties and objects are stored within the LYR file. Another option is to save the sublayers of the analysis as feature classes using the Export Data command. The next set of steps show how to export the Routes sublayer to a feature class.

Steps:
  1. On the Network Analyst window, right-click Routes (1) and click Export Data.

    Clicking Export Data

    The Export Data dialog box opens.

  2. In the Output feature class text box, type or browse to a location to save the results in, such as C:\ArcGIS\ArcTutor\Network Analyst\Tutorial\SanFrancisco.gdb\Exercise3_Route.
  3. Click OK.

    The route's feature is saved to the specified workspace.

  4. Click No when prompted to add the exported data to the map as a layer.
  5. If you don't plan to work on any other exercise, exit ArcMap. Click No to discard any changes.
  6. 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.
3/25/2015