lab4_part2

ArcGIS – lab 4, part 2
March 28, 2013
Today we will cover how to join tables and make a choropleth map in ArcGIS.
Open the New York census tract layer from the previous class. Also on the course web
page is a file, “wash_pov.txt”. This is a comma-delimited text file containing the overall
poverty rate for each of Washington County’s 17 census tracts from 2000. (Normally you
wouldn’t be able to mix 2000 census values with 2010 census boundaries, but no changes
were made in this county, so the example still works).
Download this file and open it within ArcGIS using the Add Data button. It should
appear as a layer, but not a mappable layer – it is merely a text file. To map the data for
this layer, it has to be joined to the census tract layer.
First we need to find out which fields to join. Right-click on the tract layer and choose
Open Attribute Table. Then right-click on the poverty data layer and choose Open. Find
the fields that represent the census tract the same way. Next, select the map layer, rightclick and choose Joins and Relates  Join.
You should find that no fields are available from the text file to select from. What is
going on?
The problem is a very common one – there are conflicting field types (character versus
numeric). They may look the same in the table view, but they are really different and so
cannot be joined together without a little extra work.
1
To see the field types for a given layer, select the layer, right-click and choose Properties
 Fields. The wash_pov.txt fields are all numeric, while the corresponding field in the
census tract layer is text. In general, nominal variables like census tracts and ZIP codes
should be treated as character variables because they can have leading zeros and may
contain letters (as in many foreign postal codes). So, the task is to create a new field in
wash_pov.txt that has the tract stored as a character variable.
If you are familiar with manipulating text files, you may know several ways to achieve
this. Here is the ArcGIS way. First, we need to convert the file to .dbf, because that is the
only file format that ArcGIS supports for editing. Right-click on the text file, then choose
Data  Export. When asked if you wish to add the exported data to the current map,
choose yes.
Next, we have to add a new field to wash_pov to store the tract value as a character.
Right click, then Open, then Table Options
, then Add Field. Add a new field that has
a type of text and a length of 6 (census tracts are officially 6 characters, even though they
are not always written that way – tract 804 is officially written 0804.00)
The new field is blank; now it needs to be populated. This is done by editing the table.
Open the editor toolbar, if it is not already open (if it’s not, click on this button
) and
choose Editor  Start Editing. You will be asked which file you want to edit – make sure
you choose the .dbf file you created, not the original wash_pov.txt. You can now type in
census tract values in the new field and they will be stored as character. A faster way than
typing in all of the numbers is to update the field through a query. Right-click the field
name for the field that we want to populate and click Field Calculator. The calculation is
pretty straightforward: we just want the new text field to have the same value as the
corresponding numeric field.
2
Notice the text field is left-justified, while the numeric field is right-justified (a clue for
rapidly distinguishing between text and character variables):
To save these edits, choose Editor  Save Edits and then Editor  Stop Editing.
Now, finally, it is time to join the two tables. Once again, select the census tract layer,
right-click and choose Joins and Relates  Join. This time the new field that you created
will be available. You may be asked if you want to create an index. This is a way of
optimizing computational speed for large databases. For a table with only 17 records it
really makes no difference whether you choose yes or no.
3
Making a choropleth map
To get to the thematic mapping functions, right-click on the census tract layer, then
choose Properties  Symbology. To make a choropleth map, choose Quantities and
Graduated Colors. In the “Fields” box, specify the poverty rate field. Under classification,
choose 5-class quantile – access this through the Classify button. Choose one of the color
ramps the software provides. That should yield something like this:
Note the label field – that is what will eventually appear on your final map. You will
want to replace “0.043900-0.066100” with something more readable like “4.4 - 6.6”.
I believe all of the ColorBrewer color ramps are available here, but they are mixed in
with others that are not as effective. When in doubt, obtain the color specs from
ColorBrewer and add them in yourself. Double-click on a color in the Symbology
window, then Fill ColorMore Colors calls up this window:
4
ColorBrewer provides colors in all 3 of the above specifications (CMYK, HSV, RGB).
The final map product should look something like this:
To add other data elements such as a legend, scale, title, and descriptive text, first switch
to the Layout view (View  Layout View). Open the Drawing toolbar if it is not already
open (CustomizeToolbarsDraw). From here you can add symbols and text to the
map. For a shaded background, use the rectangle tool
to draw a rectangle to fit the
frame, then right click it and choose OrderSend to Back. The Insert menu offers a
variety of items that can be added to the map, such as a legend, neatline, scale, and north
arrow. With a bit of effort and practice, you can develop something like the map on the
following page (I’ve also projected the map to UTM zone 18N).
5
6