ArcView your data
Our strategy in this lab is as follows:
First, get you up and running in ArcView, and have you load in some
of their data (US counties). A query will get you to a data set containing
only the Illinois counties.
We will then add in additional data layers: both the data you
downloaded last time for Illinois counties, plus some of Geoff
Jacquez's Illinois cancer data. You will choose one data set (there
are 30 cancers or so), although if you finish early, you are welcome
to do more.
Finally, you will carry out some of the elementary analyses
discussed in the last lecture, including overlays and buffering, and print
your resulting map.
Getting Started: IL Counties
- Run ArcView.
Umich students: on the lab computers this is done from the Start
menu as follows:
Start -> Course Software -> Snre -> ArcView 3.1 -> ArcView
GIS Version 3.1.
- ArcView may ask if you want to create a New Project (with a new
view). Why not?
As you create a new project, notice the window that is in the
background. This window (called "Untitled" by default) we will call
the Project window. As soon as you have
accepted to create a new project, you will also have a View Window.
- ArcView will then ask if you would like to add data to the view now:
again, accept their charitable offer.
By doing so you indicate that you now want to add a theme (this
means view a data layer, or data set). The data set you will want to select
is one that is provided by ESRI, and so is found from a directory containing
their data sets: esri -> esridata -> usa -> counties.shp.
- Having selected this data set, ArcView produces nothing in the view,
but to the left in the View Window you see the name
"counties.shp", with an unchecked check-box, and color patches. Click on the
check-box.
- A map of the USA appears, with all the
counties drawn in. This is an example of a map of vector data, where the
vectors determine a set of areas (polygons), rather than strictly linear
features.
Click on a county in the map. By default, you should be in "info
mode" (the little "i" in your cursor tells you that you're in info mode), so
it will tell you where you are, what's there, etc. (Notice the
FIPS code, mentioned in an earlier module.) You are performing a
Query, and discovering that the areas have attributes
associated with them, which are reported each time you click on an area.
- Under the Window menu item, try switching between Cascade and Tile
modes (just for fun).
- Since we ultimately want to focus on the state of Illinois, you will
want to zoom in. On the menu bar you see the magnifying glass with a plus
sign:
Click that, and you're in zoom mode. Note
the difference between clicking on a spot, and dragging the left mouse over
an area (creating a new viewing rectangle). Try the "zoom out" mode
too (minus sign). In the end, zoom in on Illinois.
- Now we want to do a selection: we want to select only those counties
of Illinois. This time you will construct a query, by clicking on the
hammer icon
(where do they get these icons?? I guess
hammers are associated with construction. Of course!).
We want those counties in Illinois, so one way to do the Query is to
double click on State_name, then, when State_name appears in the query
builder box below, click on the equal sign, double click on "Illinois", then
click on "New Set".
Here's what the query looks like.
Under the View menu item, you can click on "Zoom to selected", and
Illinois appears, as if by magic.
- Now convert your new theme (counties of Illinois) to a shapefile (that
is, we want to create a new file which contains only these counties). Go to
the Theme menu item, and select "Convert to Shapefile". You'll want to save
the resulting shapefile (call it illco.shp, to stay consistent with this
lab) to the illinois directory in your account (which you recently created
as a subdirectory of the data directory you created in the last module when
you downloaded the Illinois census data - if you didn't yet download the
data, then please do! Return to the first
module's lab and follow directions). Go ahead and add the shapefile to
your current View (it will ask you if you want to - of course you do!).
- Now that you have Illinois counties, you can get rid of the other theme
(counties). Click on the legend of the counties.shp theme (making it the
"active" theme). This will bring that theme button forward. Go to the Edit
menu item, selecting Delete Theme (you are not deleting files, only removing
"themes" from the project - you can get the county map back any time you'd
like, by just following the directions above).
- At this point you should save your project, as you've done some
meaningful work on it. Under the File menu item, you'll find "Save
Project". Again, save this project to your account area. If you now look in
your illinois directory, you will see some new files, including a .dbf
(dBase file) which contains the attributes of the Illinois counties.
- Go get a drink of water: you deserve it.
The Attribute table
- Have a look at the attribute table associated with this vector map
theme. To do that, click on the legend (note that many buttons become active
once you do that). Click on the Theme menu, selecting Table. This
should produce a small spreadsheet of your theme's attributes.
- If you double click on the legend of your view there are several
options with which you may want to experiment. Change the classification
field from Single Symbol to Graduated Color. Classify by 1990 Population,
normalizing by the 1997 population value, and click the Apply button. What
conclusions can you draw from this choropleth map?
Joining and adding tables
We are now ready to add in Geoff's Illinois cancer data. There are two
different kinds of data that you will want to add:
- one is disease data (by county);
- the other is a site file containing the locations of the nuclear
power plants (which bear no particular relation to the counties).
In the case of the disease data, we will join it to the attribute data for
the illco.shp file. You are essentially adding attributes to the counties
(disease rates).
In the case of the nuclear sites, we are simply adding an additional point
data set (or point theme) to the project, which can be overlaid on
the vector county theme. Here are the steps:
- You will now get one set of the disease (cancer) data and save it to
your illinois directory. Here's a list of the
available cancers: pick one and remember its number.
Disease data is in ASCII format. There are thirty cancers (this is the same
data used in Geoff Jacquez's
article). Choose your cancer file (the .txt
file, e.g.
il01wm.txt
for lip cancer in white males) from this
directory.
Spend a minute just examining your file. Note the (modest!) amount of meta
data at the top of each file.
If you see any -9.000 values in your file (e.g.
il01wm.txt
), can you guess what
-9.000 stands for?
In case you're interested, have a look at
an example of the raw data, in the DAT formats (Yuck!). When downloading
data from across the internet, or receiving data from a colleague, it often
arrives in a format which must be processed before you can use it in
your software. This may be extremely painful at times....
- You will need to edit this ASCII disease data file to conform to
ArcView's import facility.
You can do this in any word processer you want (e.g. Notepad, Word),
but make sure that you save the result as ASCII text (and use the .txt
extension). For this reason you may want to consider using Notepad: it saves
everything in ASCII. You will see that your cancer data is in six
columns. ArcView expects the data to be delimited (that is, the columns
should be separated) with either commas or tabs, and to have a single line
at the top of the file (delimited in the same way) which indicates the name
of each column's variable. You can use whatever names you like for these
variables.
To save you all a lot of pain, I've already tab delimited the
files. They weren't originally tab delimited. I've left you the remainder of
the pain. Good luck. The tasks are thus to
- Once you're ready with your file, you will click on the Table icon
in the Project window
(activating the table menu items). Under the Project menu, you see Add
Table, which is precisely what we want to do. Let's start with the cancer
data file file. You'll want to import in text (rather than dbf) format.
Once you've imported the table, you'll see that it has been
added to the list of tables.
- We will now join the cancer data to the attribute table of the
illco theme: that is,
we want to add the attributes in the cancer data to the attributes that ESRI
saw fit to provide with the county areas. You need to
- open both tables (the cancer data and the attribute table);
- Start with the cancer file (the order is important!): click on the
column name you gave to the FIPS column in this file (we will join the files
using this column), then
- click on the column name of the attribute file's FIPS code (the 5 digit
code). Again, you should be looking at two columns containing the same type
of information: if not, they won't match up, so you'll join nothing!
- The little "seat belt" icon (join!) should be
illuminated in the menu
at the top: click on it, and you see that the attribute file has just grown
by the columns in the cancer data set: the cancer data has been joined to
the attribute table.
- Now if you go back in and fiddle with the legend, you will see that you
can plot other choropleth maps, based on the new cancer data.
- Save the nuclear
power plant data (ilnukes.txt) to your illinois directory, then load it
into ArcView, following the same Add Table procedure. This
time, however we don't want to do a join: there's nothing to join the nuke
data to! No place to hang a hat on counties.
- Load in the data you downloaded last time (the county(a/b).csv data -
both files),
using the Add Table option from the Project menu. This file is delimited in
a different way, with commas, but ArcView will know what to do so long as
you specify text format (although it will not show the file, because its
name does not end in .txt or .dbf - you will have to type in its name,
e.g. countya.csv). This data too can be joined to the attribute table
(remember: order of the join matters: do the target second). Your
attribute file should be getting pretty big!
Adding Sites to your view
- Click on your view to make it active. To now add these nuclear power
plants to your view as site data, you'll need to "add an event theme". This
is done from the View menu at the top. Add the countya file and the nuclear
sites file as event themes. (Note: countyb can't be added as an event theme
as-is, because it doesn't contain the lat-long coordinates (those are in
countya.csv). If you wanted to include it with the point theme, you could
first join the two county tables.)
Once you add them, you'll know what to do: display them first
(effectively creating an overlay of data layers), and then play with
their legends. You can now add the nuclear sites to your "analysis" of cancer.
Buffering
Now to an actual analysis: to find all county centroids within 60 miles of a
nuclear plant. "Centroids" are "centers of areas" (although they are not
necessarily in the center of the areas in any real sense. Illinois centroids
are contained in the countya.csv file, so we'll use that theme and the
nuclear sites for this analysis.
- From the View menu, choose Properties, and set the distance units to
miles.
- Click on the legend of the event theme associated with countya, to
make it active.
- From the Theme menu, choose Select by Theme.
- A dialog box appears. You'll want to choose the relationship "Are
within distance of", choose the nuclear site theme, and put in 60 miles for
the distance. Hit new set, and away you go!
- The selected sites can be identified from the table.
- Now create a "layout" for your map. With the view window active, select
"Layout" from the options available from the "View" menu item on the top
menu bar. Make your layout full screen, edit it (change the title, for
example, by clicking on it), and make a pretty (perhaps even useful) map.
Print it out when you're done.
Umich students: when the print dialog comes up, use Native OS rather than
ArcView Enhance or ArcView Basic for the print. Write a brief
interpretation and hand it in. Geoff would like these, just for fun. Don't
sweat it, but do your best. Label it with Cancer type (we don't need your
name, unless you're feeling proud of the result).
If you're feeling adventurous...
try out the following:
- Try some additional queries. In which counties are there fewer then 500
10 to 13 year olds?
- Add additional ESRI data themes (e.g. rivers, from the same directory
as the counties.shp file).
- you may want to return to the
ftp site
for the census data and pull down some of the place information
(e.g. placea): this is site data for cities and towns in Illinois, also in
.csv file format (it's big: about a meg when uncompressed).
- Get a start on digitizing (we'll do this in
a later module).
and don't forget to evaluate the lab.
Website maintained by Andy
Long. Comments appreciated.
aelon@sph.umich.edu