|
On-line
Resources - External Sites
AGI
- The Definitive GIS Dictionary - Choose GI
Resources to access Dictionary
Esri
Virtual Campus - Information, On-line tutorials
Geography
Network
GIS.com
- Training, Software, Data, etc.
Example:
Canadian
geospatial and profile census data:
Preparing the data for mapping
by
Richard Pinnell
This article will
describe how to access and manipulate 1996 Canadian census data to the
point where it becomes possible to visualize the data in map form. The
process of actually mapping the data (i.e., creating thematic maps)
is beyond the scope of this article. In order to follow these step-by-step
instructions you will need to download census data from the TriUniversity
Data Resource (TDR) Web server and you will need to have access to software
including:
- geographical
information system (GIS) software,
- Beyond 20/20
browser software, and
- spreadsheet or
database management software (e.g., Microsoft Excel).
The University of
Waterloo and the University of Guelph each have a campus site license
for GIS-related products from ESRI; consequently ESRI GIS software such
as ArcInfo and ArcView is available in a number of academic departments
and in both libraries. This software is also available in the Geography
Department at Wilfrid Laurier University. Because of its widespread
availability I will illustrate using ArcView (version 3.2) desktop mapping
software throughout the following exercise. However, other desktop mapping
programs could be used including, for example, MapInfo. Beyond 20/20
software is available for free download from the TDR Web server.
The following exercise
focuses on a common source of difficulty, that of attempting to "join"
two data tables in order to begin mapping. I will illustrate this procedure
by using census data for the Kitchener Census Metropolitan Area (CMA).
I decided to work with data at the census-tract level because this is
a popular level of aggregation for study and analysis, and also because
the census-tract data is particularly difficult to join.
Downloading Data
from TDR Web Server
1) Begin
by downloading geospatial census boundary data from TDR. In this example
we are interested in the census tract boundaries for the Kitchener CMA,
an area that includes the cities of Kitchener, Waterloo, and Cambridge,
and the municipal townships of Woolwich and North Dumfries.
- On the TDR page
http://tdr.tug-libraries.on.ca move the cursor over TDR Data, then
over Geographic Files and click.
- Scroll to Digital
Boundary Files (DBF) and click on this link.
- Scroll to the
first of the two tables on this page and locate the desired link at
the intersection of the Province column and the Census Tracts row;
choose ArcInfo 1996 data.
- You have now
reached the point where you can select a data file and download it;
the file to download is named gct_035a.exe (678k). Embedded in this
filename is the Statistics Canada code for the province of Ontario
(35). A page describing the complete set of geographic codes and abbreviations
used by Statistics Canada may be found at http://tdr.uoguelph.ca/GEOG/abbrev96.htm
- Download this
file and uncompress it by double-clicking the filename; the file inflates
to gct_035.e00 (2833k). Students working on lab machines need to be
aware that executable files may be blocked; if so, save downloaded
data to a zip disk.
2) Next you
will need to download the census profile data you wish to visualize.
In this example we will download 1996 Profile data in Beyond 20/20 format.
We want to map the total number of economic families in private households
by census tract (within the Kitchener CMA).
- On the TDR page
http://tdr.tug-libraries.on.ca, move the cursor over TDR Data, then
over Web Retrieval and click.
- Once past the
Data Access and Use Restrictions page you will want to highlight the
topmost category (Canadian Census: Restricted Access) and then click
Submit Group.
- Scroll down to
Census 1996 - Profile Series - B2020 Tables and highlight. Then click
on the Submit Data Base button.
- Navigate past
the Data Access and Use Restrictions page.
- Scroll through
the list of until you see the category entitled Private Households,
Housing Costs, etc. and click on the second link--Private Households,
Census Tracts--to begin the download.
Manipulating
the Data Using ArcView and Beyond 2020 Software
Now that you have
downloaded the geospatial and profile data, you must manipulate the
contents of these files so that they can be "joined." The
process of joining two files (or tables) involves, in this example,
matching each census tract area (there are 82 of these areas--also called
polygons-- in the Kitchener CMA) with the corresponding census tract
profile data; the correspondence is a one-to-one relationship. In order
two join two files (or tables) there has to be a "common linking
field," a field that is common to both tables. These two fields
must match exactly; otherwise the joining procedure will abort or, worse,
will provide erroneous results.
1) Begin
with the census boundary file, gct_035a.e00.
- Use the Import
utility accompanying ArcView to convert this .e00 file to an Arc coverage.
The .e00 file is in Interchange (ASCII) format and cannot be read
directly by the GIS software. In this example, I will name the coverage
"ct_ontario."
- Open this polygonal
coverage in a View using ArcView. You will notice that all of the
tracted areas across Ontario open in this View.
- Then select and
save out the census tracts for the Kitchener CMA (we are not interested
in the tracts for Toronto, London, Hamilton, etc. at this time). Open
the attribute table for the current theme (i.e., the census tract
polygons) by clicking the Open Theme Table button. Select Query in
the Table menu. Since the unique CMA ID code for Kitchener CMA is
"541" we can use this value to make our selection. The query
box should contain this statement: Cmauid="541"; then click
New Set.
- Switch back to
the View and save out the Kitchener CMA tracts as a shapefile by clicking
Convert to Shapefile in the Theme menu. Name this shapefile "ct_kitch"
and bring it into the View when prompted to do so.
You might want to
take a look at the attribute table for this shapefile; again, click
on the Open Theme Table button. If you look at the field named Ctuid
you will see string values that take the form "541XXXX.XX",
where 541 is the CMA code for Kitchener and the remaining six characters
are place holders for the census tract "names" (i.e., IDs).
This field will be used to link the geospatial data and the profile
data; it will be our common linking field.

2) Now open the Profile data in the Beyond 20/20 browser. The
file you are opening is named pr9ct.ivt (1166k) if you downloaded the
file I suggested above.
- As a first step,
"flip" the table by moving the Geography dimension to the
rows and the Profile variables to the columns. You can do this by
clicking anywhere in the Geography header along the top and then dragging
the cursor to the left side of the screen. The Geography labels (i.e.,
the row labels) look complex and indeed they are! Again, we will want
to select and save out data for the Kitchener CMA since we are not
interested in the profile data for Toronto, Hamilton, etc. at this
time.
- To find the Kitchener
census tracted data, click on Search in the Dimension menu; highlight
English Desc and type "Kitchener" in the Text to Find box;
click OK.
- Select Show All
in the Dimension menu.
- Hold down the
Control key, click on the first row of data for Kitchener CMA and
drag to the last row of data for Kitchener CMA
- Still holding
down the Control key, select the Profile variable(s) of interest.
In this example, we will choose the first field (or column), the one
to the immediate right of the Geography labels. This variable is entitled
"Total number of economic families in private households."
Click in the header for this field to select it.
- Now save out
the data by choosing Save As in the File menu. Select a convenient
directory for the datafile, select dBase Files from the list of file
types, and name the file "data.dbf."

Manipulating the Data Using Excel
At this point it
is necessary to convert this file to dBase IV format; it is rather unfortunate
but unless this is done, ArcView will not recognize the tabular profile
data. An easy way to make this conversion (but by no means the only
way) is to open data.dbf in spreadsheet software such as Excel.
- Simply open the
file in Excel then immediately save it out as type DBF 4 (dBase IV).
Excel asks if you wish to save your changes; click the Yes button
and name the file profile.dbf.
The table is now
ready for use in ArcView.
Creating a Common
Linking Field Using ArcView Software
- Bring profile.dbf
into ArcView by navigating to the Project window, then clicking on
Table and Add. Choose files of type dBase, then open profile.dbf.
This table will have two fields, one named "Geography" and
the other named "Total number of persons." Observe the lengthy
values in the Geography field. We need to convert these census tract
labels to strings that take the form 541XXXX.XX; once that is done
we will have recreated the common linking field in our profile data.
To accomplish this, we must edit profile.dbf.
- Begin editing
by opening the Table menu, then selecting Start Editing.
- To create a new
field in the table, click Edit then Add Field.
- Type the following
into the Field Definition box: the Name of the new field is Ctuid
(we can choose any name we wish), the Type is String, and the Width
is 10 (i.e., 10 characters including the period).
- To fill in the
values, first click Calculate in the Field menu. The calculation is
based on the following instruction: Ctuid=541.AsString+[Geography].Left(7),
which means that the Ctuid string is created by adding the Kitchener
CMA code as a string to the left-most 7 characters in each of the
Geography labels (i.e., the set of characters representing the census
tract "names.").
- To finish the
process click OK, then Stop Editing in the Table menu, and finally
answer Yes when asked whether you wish to Save Edits.

Joining the Data
Tables
You can now join
the spatial data and the profile data.
Updated 2004/12 cp
|