Lab Exercise 4: Database Aggregation and Chart

Massachusetts Institute of Technology
Department of Urban Studies and Planning
11.520: A Workshop on Geographic Information Systems
11.188: Urban Planning and Social Science Laboratory
Lab Exercise 4: Database Aggregation and Chart Creation in ArcView In this lab, you will explore using ArcView's 'Summarize Table' functionality to aggregate data in tables and
then explore displaying these data with charts.
I. Fixing the One City-Multiple Polygon Problem
Recall that in a recent lecture we used the MassGIS map of Massachusetts cities and towns to compute
population density for cities and towns. We created a thematic map showing the listed population for each
city and town divided by the 'Area' column in the Attributes of Towns table. The results looked strange
and we noticed that the density of some areas was extremely high. On looking more closely, we found that
small islands in Boston Harbor were being credited with all of Boston's population, thereby creating the
impression that these islands were extraordinarily densely populated, when in fact many of these islands
probably have no population at all. The basic problem is that the population data counted people in entire
city (or town) whereas the map sometimes had multiple polygons for a single city. In the case of Boston, for
example, East Boston and Charlestown are separated from the rest of Boston by Boston Harbor and the
Charles River and each of the harbor islands is represented by a its own polygon - and a separate row in the
Attributes of Towns table. Hence, we have a 'one-to-many' database problem whereby each city or town
may be associated with more than one spatial feature. We looked at a way to resolve this problem using
ArcView's 'Summarize Table' function. In this part of this lab, you will replicate solving this problem, with
some modest variations in the procedure. This time, we will strive to obtain a better estimate of population
density by excluding small islands of 100,000 square meters (10 hectares) or less.
Open ArcView and create a View window containing the $MASSGIS/2000/state/towns and
$MASSGIS/2000/state/majrdmhd layers. You first need to navigate to the directory containing the
coverages, $MASSGIS/2000/state, then choose the coverages from the list of themes. For the majrdmhd
layer, make sure to select the arc features in the coverage. You can do this by clicking once on the folder
icon to the left of the coverage name and then selecting the arc features from the list that appears. Simply
double-clicking on the majrdmhd layer will bring up the default feature, route.route, which you do not want.
Modify the theme properties of the Majrdmhd theme so that it only shows the limited access highways
(Class = 1) and rename the theme to Limited Access Highways. Make a copy of the Towns theme by
* Refer back to the assignment section.
copying and pasting the theme in the view. For one copy of the theme, modify its theme properties so that
the theme's definition is defined by this query:
( [Area] > 100000 )
Now modify the other copy of the Towns theme so that it is defined by this query:
( [Area] <= 100000 )
Rename this theme to Small Islands. Zoom into Boston and the harbor and turn the Small Islands
theme off and on so that you can see the smaller harbor islands that you excluded from Towns.
Now we want to create a new table that aggregates the area by town for the Towns theme. The new table will
contain the name of the town, the total area for that town (exclusive of the islands), and the town's
population for 1980 and 1990. Use the Theme > Table menu item to display the attribute table for Towns.
Since we want to group the area by the name of the town, select the Town field in the table. Make sure that
none of the towns are selected; if any are, then your summary table will contain records for only those towns.
Now, select the Field > Summarize menu item. The Summary Table Definition dialogue box should
appear.
First,
change
the
name
of
the
output
file
from
the
default
to
/mit/11.520/users/[yourid]/town_density.dbf. Now, select:
Field: Area
Summarize by: Sum
Click the Add button, and Sum_Area should appear on the right.
Now, repeat the procedure for the Pop80 and Pop90 columns, only this time summarize by First. For these
columns, the value will be the same for all the towns, and we don't want the sum, but rather this common
value. The First option will report the first value ArcView finds when scanning the table for that town. We
could just as easily use the Last, Average, Minimum, or Maximum options. Think about why this is true.
Also consider why First is likely to be least computationally intensive of all these options. Finally, why
would selecting Sum definitely not work?
ArcView will automatically add the table you just created, town_density.dbf, to your project. We now
have the raw data we want -- the town areas and the populations -- but we have not yet computed the
densities. Let's do that now. Using the techniques you learned in Lab 3* for editing data tables, add these
fields to your table:
AreaMi2
PopDen80
PopDen90
Town's area in square miles
Population density per mile in 1980
Population density per mile in 1990
To convert square meters (the units of area stored in the theme) to square miles, divide by 2589988.
* Refer back to the assignment section.
When you're finished with the calculations, join the town_density.dbf table to the Attributes of Towns.
as described in the section entitled "Merging Data Tables" in Lab 3*. Now create a thematic map of the
population density in 1990. Focus your map on eastern Massachusetts just past Interstate 95 (a.k.a. Route
128), Boston's inner ring road. Use the Small Islands theme to show the islands colored white. Turn in a
layout of your map electronically in PDF format. When using the turnin command, use assignment number
4.
If you have extra time, you can consider making a similar map of the 1980 population density and
comparing it with the 1990 density map.
II. Creating Charts in ArcView
ArcView's charting tools are somewhat meager compared with, say, a spreadsheet like Excel. For example,
you can't easily plot a histogram of the population density that you just computed since it is cumbersome
(using ArcView's table manipulation tools) to group the data into intervals. Moreover, the charting tools
cannot handle more than about 50-100 rows of data. Nevertheless, the charting tool can be handy for
exploring patterns among small sets of data. To illustrate, let's chart our newly computed population density
and examine the relationship between population density and town size.
Make active the Attributes of Towns table (into which you have joined the newly computed population
density). Make sure that no rows are selected and then select the Table > Chart menu item to open the
Chart Properties dialogue box. Add PopDen90 as your group and use the name of the town (the Town
field) to label this series. Click OK and a chart window will pop up -- but it will say, 'Too much data. Please
select fewer rows'. Highlight the View window with the map, make sure the Towns theme is selected and
use the point-and-drag selection tool
to highlight several towns on the map. You'll notice that the
chart window now shows a bar chart of the population density for the selected towns.
On closer inspection, you'll notice that the chart is misleading. If you zoom in near Boston and select towns
near Boston Harbor, you'll notice that Boston shows up more than once in the bar chart. This is because the
Attributes of Towns table has more than one row for Boston -- one for each harbor island and for other
isolated parts of Boston such as East Boston and Charlestown. Each piece of Boston is estimated to have the
same density and we'd like to have Boston (and the other towns) show up only once on the chart. We can
accomplish this by using the table town_density.dbf that we created in Part I of this exercise by using the
Field > Summarize menu item in order to compute a more meaningful population density. At the moment,
this table is joined into the Attributes of Towns table (so we can create a thematic plot of population
density). We still want that thematic map, but we also want to work with the grouped table to get a
meaningful chart. To do this, we can 'link' the grouped table town_density.dbf to Attributes of Towns
as well as 'joining' them. (Alternatively, we can create a new table that is grouped into one row per town and
then link that to the Attributes of Towns table.) Once town_density.dbf is linked into Attributes of
Towns, selecting a row in Attributes of Towns will select the corresponding row in town_density.dbf.
Because links are unidirectional, selecting a row in town_density.dbf will not select the corresponding
rows in Attributes of Towns. Linking is useful here because we can select towns on the map, which will
in turn select rows in both tables. We can then use town_density.dbf to make a good chart, since this table
has only one row per town, unlike Attributes of Towns.
* Refer back to the assignment section.
Open a new copy of the town_density.dbf table by making the Project window active, then clicking on
the Tables icon, and double-clicking on the table name in the list. As with joining, linking tables can be
tricky since the direction of the link affects which table selections get propagated to the second table. Select
the Town field in town_density.dbf, then activate Attributes of Towns and select the Town field there.
With Attributes of Towns still active, choose Table > Link to link the tables together. Now generate a
new chart based on town_density.dbf. Select a few towns in the new town_density.dbf table and you'll
see the bar graph of town density -- with only one bar per town. Now select a few towns from the map in the
view window. You should see them highlighted in town_density.dbf and in the chart. If you don't, then
you linked the tables in the wrong direction. Unlink and try again.
Create a layout that includes a map indicating the dozen or so towns you've highlighted on the map, a table
listing those towns, and the chart you created. You will need to add chart and table frames to a basic map
layout. Be sure to include Boston so we know that you've properly collapsed the town. Create a PDF file
from the layout and turn it in electronically. As before, when using the turnin command, use assignment
number 4.
If you have extra time, experiment with other chart types. In particular, experiment with plotting population
density vs. town size (area) and population change (1990/1980 ratio).
III. Assignment
Please turn in two PDF files, the population density map you made in Part I and the layout with the map,
table, and chart you created in Part II. Turn in everything electronically using the turnin command using
assigment 4 (e.g., 'turnin -c 11.520 4 part1map.pdf'). No hard copy is required. The assignment is due before
Lecture #10.
* Refer back to the assignment section.