GEO 580


LAB 5: Network Analysis

Suggested time for completion: One week


Outline:


5.1.  Purpose

5.2.  Introduction and background

     ArcInfo 8 provides fairly comprehensive utilities for network analysis.  This lab is designed to introduce you to the basics of networks, including setting them up for analysis, and actually using them.
 

The components of networks:
  • Edges -- The easiest analogy for an edge is an arc.  An edge is a feature that has some associated length, and through which a commodity flows (water, oil, electricity, people, and so forth).  Like an arc, an edge has two junctions (nodes), however, the intersection of two edges does not imply a junction -- for instance, in a coverage, the edge/arc representing a freeway overpass will cross over the road going underneath, however they do not intersect with one another. 
  • Junctions -- Where an edge only has two junctions, a junction can have any number of edges.  A junction allows for the transfer of a commodity from one edge to another. 


Network rules:
     In the creation of a network, rules governing the connections of edges and junctions can be set.  These rules fall into two categories:
  • Edge-junction rule -- An edge-junction rule governs which edges can connect to which junctions.  For instance, a 240 volt edge can not connect to a 120 volt junction.
  • Edge-edge rule -- An edge-edge rule governs how, and through what type of junction two edges can join.  For instance, the 240 volt edge can not meet directly with a 120 volt edge unless the edges meet through the proper volt adjusting junction.


Weights:
     A weight is a value of "cost" associated with travel on or through an edge or junction.  Weights can be assigned to either edges or junctions, and any edge or junction can have more than one assigned weight. 

Examples of weights (in transportation networks):

  • Edge -- edge length / speed limit = travel time.  The travel time would represent the overall "cost" of traveling along that edge segment.
  • Junction -- stop light wait time.  The average weight time could be used as the "cost" of traveling through that intersection.




Barriers:
     A barrier is a symbolic flag placed on the network that signifies that the edge or junction is blocked, and thus the route must find another path around. 


Sources and Sinks:
     Sources and sinks are used in network analysis to establish flow direction in a network -- i.e., if the Edge C can only be traveled from junction A to junction B, or if junction A indicates the source of all flow, and so forth.

  • Source -- The junction at which flow originates
  • Sink -- The junction at which flow stops

 
Utility Network Analyst

  • Network -- for selecting the network feature with which you wish to work
  • Flow -- for turning on or off arrows indicating the flow of each edge in the network
  • Analysis -- for enabling/disabling layers for analysis, clearing flags/barriers/results, or for modifying various options for the analysis (weights, etc.)
  • -- for setting junction flags, junction barriers, edge flags, and edge barriers in the network
  • Trace task -- for selecting the type of analysis that you wish to do 
    • Find common ancestors  -- find common features upstream from selected junction
      • Similar: Find disconnected 
    • Find connected -- find all of the edges and junctions that are connected to a selected feature
    • Find loops -- find all of the loops that make up paths between junctions
    • Find path -- find a path between two points
      • Similar: Find path upstream
    • Trace downstream -- find all of the network junctions and edges that lie downstream of a feature
      • Similar: Trace upstream
      • Find upstream accumulation 
  • -- for "solving" network analysis

 
Answer question 1:  Provide at least one example of a network analysis problem for five of the above listed trace tasks (find common ancestors, find connected, etc.)

     While the network functions in ArcInfo 8 are primarily designed for work with utilities (as can be seen in the build geometric network wizard's text that "a geometric network allows you to model the behavior of utility networks such as electrical or water networks), the included network tools can be used to an extent on any suitable data.  For this lab, we will be creating a highway network and exploring network capabilities for transportation.



5.3.  Data Copy the data to your local work folder.


5.4.  Procedures

     In this lab, we will be building a transportation network based on a highway coverage for the United States (ushwy).  This network will allow us to find the "best" path to various locations.
 

5.4.1 Preparing the highway coverage

Note: Any modifications to a coverage must be done before the creation of the network.

     Examine the attribute table for the ushwy coverage.  Note that there are fields for speed limit (SPEED) and segment length (LENGTH_MIL) included in the table***.   These fields will be combined to create a weight field for our network. 

     First we need to create a new field in the table, so open the ushwy arc properties, and click on the Items tab.  Add a new field named "TIME_USED".  The field should be of type Float, have an input width of 4, display width of 12, and use 3 decimal places.  You do not need to include an alternate name.

     Now that the new field has been added, start ArcMap and add the ushwy coverage to the view. 

     Open the attribute table for ushwy, "turn on" the ArcMap editor toolbar, and select "Start Editing."
Right click on the TIME_USED field and select the field calculator.  Use the SPEED and LENGTH_MIL fields to calculate the value for TIME_USED.

     Once the calculation is complete, save your edits and stop editing.  You should now close ArcMap, you do not need to save the map file.

***SPEED and LENGTH_MIL do not reflect actual speed limits or length of edge features.  They have been invented for the purposes of lab analysis. 


 
Answer question 2:  Why did we set the new TIME_USED field to type Float?  Why not Binary, Number, or Integer?

Answer question 3: What formula did you enter into the field calculator to calculate the new TIME_USED value (write it as you entered it)?  Why do we want to use this value, rather than either SPEED or LENGTH_MIL alone?


 
5.4.2 Creating the highway geodatabase
     Network analysis can only be done with a geodatabase, so a personal geodatabase must be created before the highways can be converted to a network.

     Right-click on your workspace folder (in the image at right, named "Sarah"), select New --> Personal Geodatabase.  Assign an appropriate name to your new geodatabase (for instance, HwyNets). 

     Right-click on your geodatabase and add a new feature dataset to hold the highway data.  Import the USHwy coverage's spatial reference information for use in the feature dataset.

     Right-click on your highways feature dataset, and export the highways coverage to your geodatabase. 


 
Possible bugs:
  • It may be difficult to create the network -- there seems to be a write lock problem in the 8.1 software (even if the file has not been used, it seems to be "in use").  If you have this problem, close all ArcInfo modules, then re-open them and try again.  If this doesn't work, restart and try again.

 
 
5.4.3 Setting up the highway network
 
     To create the actual highway network, we will use the Build Geometric Network Wizard in ArcToolbox. 

     Open ArcToolbox and navigate to this tool. 

      After reading the introductory screen, click on Next.  Use the highway feature dataset for your input feature dataset, and select the ushwy arcs as your feature class from which you want to build your network.  Enter an appropriate name for your new network.

     You do not want complex edges in your network,  the network features do not need to be snapped, we are not using sources and sinks, and we want to use weights (SPEED: type single, LENGTH: type single, and TIME: type single.  Do not fill in the bitgate size field.  To add a new weight, click on the  icon).

     Select next, and assign weights to the fields in the feature class as follows:
SPEED::Single -- SPEED
LENGTH::Single -- LENGTH_MIL
TIME::Single -- TIME_USED

     Finish the network building.

     If you refresh your geodatabase, you will see new icons representative of the newly created network.

      Now open ArcMap, and add the freeway network feature dataset.  With the dataset added, you should have both highway junctions and edges displayed.
 

5.4.4 Displaying the highway network
  • Display the highway edges (arcs) according to the segment speed limits, set the line width to 2.
  • Add highway markers as labels .
  • Add the usageog coverage as a backdrop for your network.
  • Bring up the Utility Network Analysis toolbar.

 
5.4.5 Network analysis

Find path (part 1)

     We are now going to run some simulations with the network analyst.  We want to go see the Seattle Seahawks play the Atlanta Falcons -- but the game is in Atlanta, so we need to plot the path from Seattle to Atlanta.
 
 
  • We will consider the junction of I-5 and I-90 as representative of the city of Seattle, and the junction of I-85, I-75, and I-20 to represent Atlanta.
     To plot the path, we need to place flags at the "Start" junction (Seattle), and at the "End" junction (Atlanta).  The flags must be placed in the order in which stops will be made (i.e., Start -> End).

     Go ahead and place the Seattle and Atlanta junction flags.

     Select "Find Path" and the trace task, and click on the "solve" button. 
 


 
Answer question 4: What did this do?  What does the path look like (where does it go)?  What might be "wrong" with this path in terms of it being the shortest route?

 
Find path (part 2)
     Now let's try running the same analysis, except using the weight fields that we created earlier in the lab.  To set up the network to use the weights, click on Network Analyst Toolbar --> Analysis --> Options.  Select the Weights tab. 

     Under "Edge weights" set both to-from and from-to weights to SPEED.  Since we do not have any junction weights, leave the junction weight as <None>.  Click on OK.  Now re-run the find path operation.

     Try calculating the path using each of the three weights that we set up (SPEED, TIME, LENGTH).


 
Answer question 5: Describe the difference between the paths created using the three different weights.  Why do you think they differed?  Which one should we use for our path to the Seahawks v. Atlanta game?

 
Barriers!
     Unfortunately for traveling, the game is on the 3rd of December, so there may be some weather related travel delays across the country.  Fortunately, through use of our friendly neighborhood psychic we have the advance forecast of weather and proposed road closures:
  • I-94 through Minnesota will be closed between I-29 and I-35 (freeway lost under snow)
  • The junction of I-70 and I-135 in Kansas will be closed
     To add these barriers, use the  Edge barrier flag, and the  Junction barrier flag.  These flags are placed in the same way as the junction and edge flags.

Side trips
     Unfortunately the official Seahawks Fan Roadtrip crew do not live in Seattle (the origin city), so the route must include the sidetrips to pick up our fellow fans (after all, it is for the 'hawks). 

     The cities in which we need to stop to pick up folks:

  • Princeton, N.J. 
  • Los Angeles, CA
     To create a multi-stop path (or a path that must go through certain junctions), you simply place a junction flag on the junctions to be visited -- remember that the flags must be placed in the order that the stops will be made. 
  • To clear your previously placed flags, click Analysis-->Clear Flags on the Network toolbar.

 
Your map for Lab 5: 
     Make a map of the journey to turn in.  Make sure that the path is EASILY VISIBLE on the black and white map!

 
Answer question 6:  If we pick up our fellow Seahawks fans in Los Angeles and Princeton, will we still need to worry about the predicted road closures?

Answer question 7:  You have been hired to do network analysis to coordinate delivery for a local pizza parlor.  What data sets would you need/want, what would the datasets need to contain (i.e., what fields would you require for your analysis), and how would you set up the network for use? (This question requires a fairly detailed answer, spend a bit of time thinking about this one)


 



5.5.  Conclusion

    In this lab, you learned about basic network analysis -- including creating and setting up a network -- in ArcInfo 8.



5.6 To turn in

Lab originally created by Nicholas Matzke and Sarah Battersby
UC Santa Barbara, Department of Geography
© 2000, Regents of the University of California; redistributed by permission

Last update: April 25, 2002
http://dusk.geo.orst.edu/buffgis/Arc8Labs/lab5/lab5.html