You are on page 1of 16

ArcGIS Tips January 2007

Methodological

Always ask, is the data/graphic presentation valid on substantive grounds? Is


it biased in some way or another? If so, why?
Think critically about the substantive validity of data attributes (e.g., raceethnic categories) and spatial units (e.g., census districts) in maps.
Remember that GIS is just one approach to representing space, place, and
society, with its particular set of strengths and limitations.
Always check a data set for possible errors (e.g., sum categories for
race/ethnicity, gender, and housing tenure to make sure that they
add up to the appropriate totals). Check errata (e.g., U.S. Census
errata) when they are available.

ArcCatalog

Dont put spaces or special symbols in filenames.


Dont use uppercase letters or spaces in directories or filenames for raster
data.
What if the catalog tree disappears? Window>Catalog Tree.
In ArcCatalog, why cant I delete a feature class from a geodatabase? You
cant do so while any part of the geodatabase is in use in ArcMap, and you
may have to close ArcMap.
In ArcCatalog, how to obtain the Data Conversion Wizards? Click View >
Toolbar>Customize, then click ArcGIS 8x Tools on the Toolbar tab and click
Close.
Geodatabases:
o When importing coverages, import only the polygon feature class of
the coverage (i.e. point) because a geodatabase does not maintain the
other coverage feature classes.
Better alternative: in ArcCatalog right-click the coverage,
convert to layer file, and then import the layer file (instead of
the coverage) into the geodatabase.
Or in ArcMap: right-click the coverage > Export Data > click
Use the same coordinate system as this layers source data >
specify Output shapefile or feature class > OK > Yes, display
as a layer on the map.
o When importing feature classes, to exclude feature attributes go to the
dialog boxs Field Info, the Visible field, and click false for each
excluded attribute.
o Recall that to delete part of a geodatabase you have to remove it from
ArcMap and possibly close Arc Map.
When using a geodatabase, close ArcCatalog in order to do spatial joins and
perhaps other procedures in ArcMap.
How to define a coordinate system for a coverage? Here are two ways:
o One way: ArcToolBox>Data Management Tools>Projections and
Transformations>Define Projection>drag the coverage into the input
box>select the projection.
o Another way: import the coverage into a geodatabase and specify its
projection.
o Better than either of the above: export the coverage and save as a
shapefile, then define its coordinate system.

What if I repeatedly cannot delete a file and I keep getting an in use by


another application message even when the file is no longer in use? Exit Arc
Map, and perhaps exit ArcCatalog as well and restart it.
Metadata: document the content of each variable and how it was computed.
Heres how to do so by adding metadata in ArcCatalog:
o In ArcCatalog, click the relevant variable in the tree.
o Click the Metadata button (next to Contents and Preview).
o Click the edit Metadata button on the metadata editor.
o Add or edit the documentation, then close the editor.
o Note: in ArcMap under Symbology there are ways to add descriptions
to layers.
ArcToolBox: right-click>Save Settings.

ArcMap

Dont use spaces or special symbols in filenames in general.


Dont use uppercase letters or spaces in directories or filenames for raster
data.
ObjectID field: see the end of the ArcMap section on the importance of this
field.
What if ArcMaps Table of Contents disappears? Click Window>Table of
Contents.
Why cant I reorder the data files in the table of contents? Make sure that the
bottom tab is set to Display.
What if a toolbar (e.g., Spatial Analyst) disappears? Click View>Toolbars>
Spatial Analyst. Click Tools>Customize>specific command tab. Click Save on
combobox: dropdown arrow>choose template. Drag command to toolbar.
Close.
How to get an extension (e.g., Spatial Analyst, 3D Analyst) to display as a
toolbar and to work? Two steps:
o View>Toolbars>select the extension.
o Tools>Extension>select the extension.
ArcToolBox: right-click>Save Settings.
If the measurement units dont work properly in ArcMap, then either the
current coordinate system is inappropriate or there is a problem with the
shapefile.
o Check in ArcCatalog to see if the shapefile doesnt have an associated
.prj file.
If you have another, e.g., Miami-Dade map that measures
correctly, import or select its projection in ArcCatalog: rightclick the shapefile in ArcCatalogs tree> Properties> Shape>
Spatial Reference>import the projection.
If you cant find a projected coordinate system, try importing or
selecting unprojected coordinates (e.g., WGS 1984) in
ArcCatalog (as described above for projected coordinate
system).
How to adjust display of measurement scale or geographic coordinates on
status bar? Click Table of Contents>Layer>Properties>General>Units>
Display.
What if the Identify Results window does not display when the Identify tool is
clicked?
o In Windows: click Start>Settings>Task Bar & Start Menu.

Click the General tab.


Check the Auto Hide option.
Click Apply, then OK.
Minimize all applications except ArcMap, and locate the Identify
Results window (which may have been hidden behind the task bar).
o Drag the Identify Results window to the center of the screen.
o Revert to the original task bar setting by unchecking the Auto Hide
option.
What if the Select Features tool doesnt work? Check Selection>Interactive
Selection Method: make sure that its not set to Remove from current
selection or to any other option that might obstruct the selection process.
How to eliminate unwanted fields in a layer? Right-click layer >
Properties>Fields> uncheck unwanted fields>Data>Export Data>Save under
new name.
o Perhaps click option to uncheck all fields, and then check only the
desired fields.
o
o
o
o

To avoid disrupted layer paths (meaning that ArcMap cannot locate the
layers), set map properties to store relative path names: File>Map
Properties>Data Source Options, click store relative path names (see entry
on disrupted paths).
Saving a map: always use save as to save a map as a new file, rather than
save a changed version of a previous map file, because map files are easily
corrupted.
o Make sure that youve saved relative path names.
o Its a good idea to save a maps layers together in a geodatabase.
Why is there a red exclamation point next to one of the data layers? Because
the paths among the data sets files have been disrupted so that ArcMap
cannot locate the indicated layers.
o Note: An ArcMap project file (.mxd) makes a set of data paths to
integrate data files into a project. Creating a layer attaches paths to a
data file.
o Saving relative path names and saving the relevant data together in a
geodatabase folder reduces (but does not eliminate) the chances of a
disrupted path occuring.
o How to repair a path in ArcMap: right-click the layer>Source>set to
data source>add. Check that the red exclamation point has
disappeared.
o See Help>Repairing Data Sources in ArcCatalog: right-click on the
layer and inspect its source properties. Click Set Data Source button
and orient the layers data source to the appropriate shapefile. Check
that the layer file symbolizes correctly on the map and that it has no
broken links icon in the Table of Contents. Right-click the layer and
Save as Layer File.
If a shapefile wont display correctly, check in ArcCatalog to see that there is
a .prj file with the shapefiles name. If it doesnt, then select or import an
appropriate coordinate system.
Why does a layer have no attribute table? Floating point grids dont have
attribute tables, so check the field type (Properties>Fields).
How to create a group layer, which enables better organization of a maps
layers:
o Right-click Layers in table of contents.
o Click New Group Layer.

o
o
o
o

Right-click the New Group Layer that results and click Properties.
Click General Tab.
Type the group layer name under Layer Name.
Add a layer to the group by clicking Group tab in the Group Layer.
Properties window, clicking the Add button, navigating to and clicking
the shapefile to be added, clicking the Add button again, doubleclicking the group layer name, and clicking OK.

How to combine two or more data categories into one?


o In the table of contents, right-click the layer for which you want to
combine categories and click Properties> Symbology. If necessary,
following the instructions for drawing a layer showing unique values.
o Right-click over the values>Group Values, and reformat the label>OK.
o If necessary, right-click the layer in the table of
contents>Properties>Ungroup Values.

In ArcMap, how to obtain the Buffer Wizard? Click Tools (not


ArcToolBox)>Customize>Toolbars>Commands: Categories - Tools>
Commands: Buffer Wizard. Then click and drag the Buffer Wizard icon on to
a tool bar.
o A simple way to create buffers: click Edit tool, click feature to buffer,
click Target Layer dropdown arrow & click the layer with the type of
feature you want the buffer to be (line or polygon), click the Editor
menu and click Buffer, type the distance in map units, and press
Enter.
o During an editing session, you can use ArcToolBox>Analysis
Tools>Proximity>Buffer but not the Toolbar Buffer Wizard.
Why cant I reorder the data files in the table of contents? Make sure that the
bottom tab is set to Display.
I created a new table. Why isnt it visible in the table of contents? Click the
Source tab at the bottom of the table of contents.

How to join tables keeping only the matching records (i.e. eliminating null
values)? In the Tables Join dialog box, click Advanced options and click
preserve matching records only.
o Alternatively, eliminate the null values by selecting the appropriate
attributes after doing the tables join (but make sure that subsequent
operations are performed on selected features only or select from
currently selected set if you want to analyze these observations only).
o Or create layer from selected features, or, to save the file of selected
features, click Data>Export and click to display on map (clicking
Source at the bottom of the table of contents to display the new
table).
You can display multiple attributes in maps: Properties>Symbology>Multiple
Attributes.
Why cant I do a spatial join, even though theres a common field?
o If youre using a geodatabase, close ArcCatalog.
o Tables cant be joined if either table has spaces in its filename , or if
the common fields both are not string or both are not numeric .

What if I cant calculate after joining tables? Check to see if the data in
question are numeric. Or you may have to Export Data to create a new
shapefile or geodatabase. Or you may have to exit a current editing session.
Why cant I add a new field to my attribute table?
o You cant do so if youve clicked Edit>Start Editing (i.e. if youre in an
editing session), so to add a new field you have to exit the editing
session.
o You may not be able to do so if youve currently selected a subset of
attributes or locations.
o And you cant do so if the table is currently involved in another ArcMap
or ArcCatalog session.
Why cant I perform an editing session (via the Editor toolbar) in ArcMap?
You may not have shapefiles or feature classes on your map, you may have
read-only data on the map, or the layer may be in use elsewhere such as
ArcCatalog.
o You cant edit attribute table fields with raster data.

Using census data, how to create categories to name clusters of adjacent


tracts with, say, high percentages of an ethnic, income, or other group:
o Open attribute table and add a new field, say, Cluster (text>length
of, e.g., 20>OK).
In ArcMap, use the select tool to click a given clusters adjacent
tracts.
Open attribute table (if you like: Show>Selected) and rightclick column header for Cluster> Calculate Values> Yes>
Cluster= type this clusters name within quotation marks.
Clear selection.
Repeat select tool and attribute table calculation for each
cluster.
To name the remaining, non-cluster tracts as a group: Select
by Attributes> Cluster = (that is, type two apostrophes,
which means = tracts that have yet to be selected).
Open attribute table (if you like: Show>Selected) and
right-click column header for Cluster> Calculate
Values> Yes> Cluster= Other tracts.
Clear selected features.
o In ArcMap, map the clusters.

How to label only certain clusters?


o Right-click the layer>Labels tab>cluster data (Dont check the box
next to Label features in this layer)>OK.
o If necessary: View>Toolbars>Draw.
o Click Label tool on the Draw toolbar (after clicking the drop-down
arrow next to New Text tool).
o Select Place the label at the position clicked>Close dialog box.
Mouse should now have a label tag at the bottom.
o Click the center area of one of the clusters on the map (the clusters
name should appear) and label.
o To adjust the label, click Select Elements tool on the Draw
toolbar>click the label to adjust>click and move the label.
To unselect the label, click any blank area.

To change the label texts font, double-click the label with Select
Elements tool and adjust the format.
o If you need to add the name of the city, country, etc., do so using the
New Text tool.
What if theres, e.g., a map with evacuation zones for various categories of
hurricanes but theres no data category for the existing non-evacuation zone?
o To create a non-evacuation zone that permits multi-layered analysis,
create a non-evacuation zone by unioning a map layer of the total area
with the map layer for the evacuation zones.
How to combine count data with spatial zones?
o Select by location: but doesnt preserve sub-zone data (if relevant to
the issue at hand).
o A spatial join: preserves sub-zone data.
To map data after a join, you have to begin the join process by clicking the
layer that contains the spatial data.
To join by location, both layers must be spatial layers.
o Joining by location can also join tables that do not share a common
field, but, again, both must be spatial layers.
How to find the length of, e.g., roads within a spatial zone? Here are three
ways, plus a general point:
o Select by location: that are contained by the spatial zone (but does not
preserve sub-zone data) and click the appropriate column and click
Statistics or, to create table, click Summarize (with sum option).
o An intersect overlay: preserves sub-zone data. Then click the
appropriate column and click Statistics or, to create table, click
Summarize (with sum option).
o A spatial join.
o In general, confirm the consistency of results obtained from select by
location, intersect overlay, and spatial join, and adjust your strategy
accordingly.
Why wont Summarize or Statistics work for a column in the attribute table?
o Check that the data are in numeric, not string, format.
o It may be because you did the calculations while the spatial-data table
and the attribute table were joined.
o You may have to unjoin the tables and do the calculations within the
appropriate table, and then afterwards do the join.
o

Why dont procedures work in ArcToolBox? Make sure that the output box
includes the output paths full path (e.g.,: C\TEMP\.).
How to calculate not equal to? E.g.: income <> 0
How to use the wildcard (*) to select attributes? E.g., if Zoning has various
commercial categories labeled C-1 to C-5: [Zoning]=C*
In Select by Attributes, the Like rootname* option is useful to select related
variables: [District] like Residential*
Why wont my text (i.e. string) field calculation work? Make sure youve
enclosed the variable in double quotation marks.
Why wont my quantitative field calculation work?
o Make sure youve specified the appropriate type (short integer, long
integer, float, double).
If the appropriate specifications for scale and precision dont
work, try eliminating them (i.e. not providing any values at all)

or increasing them (e.g., instead of 1,1, a specification as large


as 10,4 may end up working).
o And make sure there are no zeros in the field being calculated.
Eliminate them via Select by Attributes, e.g., [Income] > 0
If a statistical procedure doesnt work, check the data: e.g., are they saved in
numeric format? should they be saved as field type=double? Is their range
too small (e.g., 0.000 0.001) to be practically significant & to map
effectively?
How to assign a constant to a field. E.g., assign the constant 1:
o Right-click column header.
o Calculate (outside a session)
o Type 1 (including quotation marks) in the field calculator.
o OK.
How to assign a categorical name to an all the rest group?
o Select by attributes: select the relevant data column category and
type = (that is, type two apostrophes to select all the rest).
o Open attribute table, right-click relevant column header, Calculate
Values (Yes)> All the rest (that is, within quotation marks).
o Map the categories.
o (See How to label only certain clusters in ArcGIS Tips.)
ID numbers such as STFID and FIPSSTCO must be saved as field type=text.

How to make appropriate calculations on numerically displayed categorical


data (e.g., months in numerical form, zipcodes)? Consider such string
operator functions in Field Calculator as Left[] or Right[]. Click String to
display these.
How to modify a primary key in U.S. Census data by combing STFID and
Geo_ID: right-click the census data label and click Open Attribute Table >
right-click Census Tracts and click Open Attribute Table > in Attribute Table
for census data, click Options and Add Field (naming it STFID > Text > OK) >
right-click STFID column heading > Calculate Values > Yes > String >
double-click Mid(), and in STFID=box type Mid([Geo_ID, 8, 11) > OK (which
extracts an 11-character string from Geo_ID starting at position 8 and creates
a new column in Attributes of Census Data to match STFID in Attributes of
Tracts).
How to join two parts of place name s (e.g., Shasta with County) to make a
usable ID in order to join the table with another table: open table > create a
new field Name, Text, with sufficient width > Calculate Value > Yes >
[PLACENAME] & & [COUNTY]. There must be a space between the
quotation marks.
How to automatically fill a column with a series of numbers: Add a new field
and format it appropriately as numerical, click Start Editing on the Editor
toolbar, right-click the column header, click Calculate Values, click the check
box for Advance, then enter the following code into the Pre Logic VBA Script
code area. After entering this code, type the word rec in the text box under
[Your Field Name = ] at the bottom of the script box, then click OK.

Static rec As Long


Dim pStart As Long
Dim pInterval As Long
pStart = 1
pInterval = 1
If (rec = 0) Then
rec = pStart
Else
rec = rec + pInterval
End if

In Excel instead of ArcGIS, how to automatically fill a column with a series of


numbers: select the first cell of the range that you want to fill, type the
starting value and the next value for the series to establish a pattern, select
the cells that contain the starting values, drag the fill handle (the small black
square in the lower-right corner of the selection rectangle, which when
pointed to changes to a black cross), and drag across the range that you want
to fill. Alternatively, use a statistics program such as Stata.

How to create new key fields to permit census joins: see Peters & McDonald,
Unlocking the Census, pages 64-72.

How to calculate centroids? See end of this document.


How to add centroids to your map as points? See Help>Making field
calculations concerning the procedure, including the VBA statements for X and
Y values (which you can copy and paste into the first text box of the
Advanced Calculator).
o After calculating centroids, open the attribute table and export it as a
plain dbf table by clicking Options>Export (from within the attribute
table).
o Make the centroids two dimensional via Tools>AddXY Data, specifying
that the map projection be the same as that of the original layer.
o Why might the centroids be computed incorrectly (e.g., one single Xvalue & one single Y-value)? Make sure that the field type is double,
and make sure youve specified appropriate precision & scale.
o On the uses of centroids in GIS, see Mitchell, ESRI Guide to GIS
Analysis, vol. 2.
o Use centroids only if the features are roughly the same size and shape.

What if dissolve doesnt work?

o
o

Keep trying while, one by one, eliminating a field previously selected


to keep.
With U.S. Census data, the problem may be that the process cant
obtain OID values.

E.g., the layer Evacuation categories does not have a category for Nonevacuation zones. How to create this category so that multi-layered analysis
is possible? Union Evacuation categories with the map from which it was
originally derived (e.g., Miami Dade blkgrp).
How to combine, e.g., several hazard risk categories of a common scale
(such as flood, erosion, and storm surge, each 1-5) into a combined total
risk category?
o Use ArcToolBox>Analysis Tools>Union flood & erosion=comb1, union
comb1 & storm surge=totalrisk.
o Save totalrisk by exporting it to geodatabase, imp orting the symbology
from totalrisk into the map layer.
o In the attribute table make a new field (long integer) named risk_sum.
Calculate risk_sum to be the sum of the risk attributes from each
hazard risk category.
o Classify risk_sums scale.
o Symbolize the layer with graduated colors.

Editing:
o For tables that dont have associated geographic features, click
Editor>Start Editing, then edit the attribute table (using the Undo
button to undo an edit). Click Save Edits.
o To add features to a coverage, shapefile, or geodatabase, use the
Create New Feature task on the Editor toolbar.
How to eliminate fields in a table (besides using delete):
o Right-click the layer>Properties/Fields>click the variable
name>uncheck the variable name in the visible box>export and save
the table so that the changes are permanent.
How to create longer, more helpful field names than can be made in an
attribute table column? Properties>Fields>Aliases (changing the alias and
exporting the file).

How to sort the data simultaneously in more than one field:


o Rearrange the fields in order of sorting from left to right.
o Click the first columns heading, and holding the Control key click the
headings of the next columns.
o Right-click each column and sort.
How to edit an attribute table & export it as a dbf table, not as a map layer?
Options>export from within the original attribute table.
Using raster data, reclassification can be done via Spatial Analyst>Reclassify
(or Spatial Analyst>Raster Calculator).
How to mask census districts that, e.g., protrude into lakes or into the ocean?
Use a water-body map file to mask the offending districts.

How to create MapTips:


o Right-click layer>Properties>Fields tab>select the Primary Display
Field>c lick Display tab>check Show MapTips>OK

If theres just one map layer, how to use two labels (e.g., state name and
number of vacant housing units in the state):
o Right-click US States>Properties>Labels>Expression (select VACANT from
Label Fields)>Append (so that Expression contains STATE_NAME and
VACANT)>OK
o Right-click US States>Convert Labels to Annotation (store annotation in
the map; create annotation for selected features)>Convert.

Importance of ObjectID field: If your table lacks an ObjectID field, you won't
be able to:

select the features in the layer on the map in any way. You can select records
in the table window, including selecting using an expression in Select By
Attributes, but this selection set is not reflected on the map.
apply a definition query to display only a subset of records or features.
create relates. You can relate to a table without an ObjectID field from a table
with an ObjectID field, however. In this case, the relate can be used by the
Identify tool to list related records. You can't push selections via the relate.
start and edit session and edit the attributes. However you can edit the table
the layer is based on directly on disk, such as in a text editor if the file is a
.txt file. Your changes will then be reflected on the map next time you refresh
the map.

There are several ways of obtaining an ObjectID field for your data.

If you are working with a table of x,y coordinates and displaying them in
ArcMap, you can export the x,y layer to a new feature class. You can also
convert a table of coordinates into a new point feature class in ArcCatalog.
Both of these procedures create a fully functional feature class with an
ObjectID.
You can use the Make Query Table geoprocessing tool, which allows you to
make the table using an OLE DB connection and to specify a column to use
for the ObjectID or to dynamically add the ObjectID.
With some data sources, you can register data with ArcGIS, which will add an
ObjectID field.

Map Making

When your map document is appropriately situated on the template, note the
map scale and zoom control settings, to which you can return if things go off
kilter as you manipulate the map.
Use the layout zoom toolsnot the corresponding tools on the Tools toolbar
when zooming in or panning in Layout View.

10

How to mask census districts that, e.g., protrude into lakes or into the ocean?
Use a water-body map file to mask the offending districts.
How to create MapTips:
o Right-click layer>Properties>Fields tab>select the Primary Display
Field>c lick Display tab>check Show MapTips>OK
If theres just one map layer, how to use two labels (e.g., state name and
number of vacant housing units in the state) for selected features:
o (1) Right-click US States>Label; (2) Format label; (3) Select features; (4)
Labels>Expression (select VACANT from Label Fields)>Append (so that
Expression contains STATE_NAME and VACANT)>OK
o Right-click US States>Convert Labels to Annotation (store annotation in
the map; create annotation for selected features)>Convert.
o Alternative way to label features selectively: use label tool on draw
toolbar.

Spatial Analyst

You can use the Density function to turn a layer of, e.g., categories of
earthquake building damage into a layer of building damage density:
o Select by Attributes the damaged buildings only.
o Spatial Analyst Density function: select damaged buildings as Input
Point or Polyline Features.
o Area units: square kilometers.
o Other parameters as required.
o OK.
When, e.g., converting a GWR-produced coverage to raster, in the conversion
dialog box specify that the raster data receive the coordinate system of the
relevant map.
How to replace areas of one value or value range with another value? Spatial
Analyst>Raster Calculator or Spatial Analyst Tools>Conditional:
CON([District] < 600,600)
How to replace areas of no data with a specified data value? Raster
Calculator or Spatial Analyst Tools>Conditional: CON(ISNULL([District]),625)
How to assign the mean of a set of values to an area? Raster Calculator or
Spatial Analyst Tools>Cell Statistics (mean being one of several options, the
others being median, standard deviation, minimum, maximum, variety):
MEAN([Oct],[Nov],[Dec])
How to truncate floating-point values into an integer (for purposes of
reclassification)? Map Algebra or Spatial Analyst Tools>Math>Trigonometric:
INT([Elevation])
How to slice a value into zones of equal value or equal interval? Command
Window: Slice_3d <in_raster> <out_raster> <number_zones>
{EQUAL_INTERVAL | EQUAL_AREA} {base_output_zone}
See Raster Calculator or Spatial Analyst Tools>Math>Logical commands such
as EQ, NE, GT, GE, LT, LE, AND, OR, XOR, DIFF, IN{list}, OVER, CAND, COR,
CXOR.
How to use Map Algebra to set a mask? Map Algebra or Spatial Analyst
Tools>Conditional: SetNull
How to append raster data sets? ArcToolBox>Data Management>Merge for
discrete data, Data Management>Mosaic for continuous data.
See Spatial Analyst Tools>Generalization commands such as Aggregate and
Region.

11

See Spatial Analyst>Tools sections for local, neighborhood, and zonal


statistics, density calculations, and interpolation.

3D Analyst

Even after I imported a base height, my raster layer file wont preview as 3D
in ArcCatalog: make sure that Preview is set to 3D, then click on the source
raster file and click on the new raster file.
In ArcScene, my raster layer file wont display as 3D:
o Right-click the layer & click View>Refresh.
o Make sure that the layer file has a base height, then if it does either
click Scene layers>Vertical Exaggeration (to synchronize the z-values
with the x,y coordinates) & click the Full Extent icon, or else import a
coordinate system into Scene layers.
What do I do if Ive extruded a layer but its dimensions are much too large?
Try clicking Scene layers>Vertical Exaggeration>Calculate from Extent.
How can I reverse a 3-D effect (so that, e.g., a bulge turns into a
depression)? Layer Properties>Base Heights>Z -Unit Conversion, then change
1.000 to 1.000 (or vice versa).
o Resetting Vertical Exaggeration may prove helpful.
If a layers attribute table contains measured elevations, extrude the layer by
clicking A constant value or expression to set heights, then click
Calculator>Fields, and select the measured elevation.

Excel & ArcGIS (previous to ArcView 9.2)

How to connect an Excel spreadsheet to ArcCatalog (for ArcView 9.0 and 9.1):
o In Windows2000: Start>Programs>Administrative Tools>Data
Sources.
o In ODBC (Open Database Connectivity) Administrator dialog box: click
User DSN tab, then click Add button. Select Microsoft Excel Drive
(*.xls), then click Finish button.
o In ODBC Excel setup dialog box: type data sources name and
description. Clic k Select Workbook. Go to location of Excel data file
and select.
o OK. OK.
o Start Excel and open the spreadsheet. Select the relevant data.
o Insert>Name>Define, and type a name for the selected data. Save.
Quit Excel.
o In ArcCatalog: use database connection and click Add OLE DB
Connection. Select Microsoft OLE DB Provider for ODBC drivers.
o Click User Data Source Name, the select the Excel file from drop-down
list (and use Refresh if necessary). Click Test Connection. OK.

How to import an Excel table into ArcMap:


o In Excel spreadsheet: File>Save as>Save as type: DBASE IV. Name
file>Save. Accept default Sheet1. Concerning formats, click Yes.
Close Excel.
o In ArcMap: Add Data>add Excel file from the folder where the .dbf
files were saved.

12

How to join an Excel table with an attribute table:


o Excel column (field) headings can have no more than 10 characters,
must start with a letter, and cant have spaces, brackets, or dashes
but can have underscores.
o Excel table and attribute table must share a common field (such as
GEO_ID).
If a DBASE file does not contain GEO_ID, it can be created by
making a new field and calculating it by combining STFID with
the missing elements that are contained in the shapefiles
GEO_ID (see below, and the assignment Census data
downloading).
o In Excel spreadsheet: File>Save As *.DBASE IV, name and save file.
Close file and Excel.
o In ArcMap: Add Data>Excel file. Right-click map layer>Join Attributes
from a Table>Choose join field from attribute table>navigate to Excel
table>Choose join field from Excel table. If desired, save the joined
tables: Data>Export Data. Undo the original join: Joins>Remove
Joins.
o See Peters & McDonald, Unlocking the Census, pages 64-72.

How to create new key fields to permit census joins: see Peters & McDonald,
Unlocking the Census, pages 64-72.

In Excel, how to automatically fill a column with a series of numbers: select


the first cell of the range that you want to fill, type the starting value and the
next value for the series to establish a pattern, select the cells that contain
the starting values, drag the fill handle (the small black square in the lowerright corner of the selection rectangle, which when pointed to changes to a
black cross), and drag across the range that you want to fill. Alternatively,
use a statistics program such as Stata.

MS-Access

See the course instructions for using MS-Access.

U.S. Census

SF1-SF4 & PL:


o SF1 and SF2 contain data on the questions asked of all households:
SF1 has the most geographic data (down to the block) and SF2 has
the most socioeconomic, housing data, and other data (down to the
block group or tract).
o SF3 and SF4 have data from questions asked of a sample of
households only. SF3 has the most geographic data (down to the
block group or tract) and SF4 has the most other data.
o PL (Redistricting data, Public Law) contains information on race and
whether of Hispanic origin, based on the Census 2000 short form.
There are four detailed tables.

13

PL includes Table PL2, which is sample race data that includes


Hispanic along with all of the other possible categories. SF3s
sample race data do not include Hispanic. SF1 is non-sample
(i.e. complete) data that includes Hispanic.
Tract-level PL data can be downloaded via American FactFinder.

How to comp ute population density: see the course instructions for computing
population density.

Downloading U.S. Census data from American FactFinder:


o See AmericanFactFinder Using AmericanFactFinder with Windows XP
with Service Pack 2 concerning internet pop-up blockers.

ID numbers such as STFID and FIPSSTCO must be saved as field type=text.


How to make appropriate calculations on numerically displayed categorical
data (e.g., months in numerical form, zipcodes)? Consider such string
operator functions in Field Calculator as Left[] or Right[]. Click String to
display these.
How to modify a primary key in U.S. Census data by combining STFID and
Geo_ID: right-click the census data label and click Open Attribute Table >
right-click Census Tracts and click Open Attribute Table > in Attribute Table
for census data, click Options and Add Field (naming it STFID > Text > OK) >
right-click STFID column heading > Calculate Values > Yes > String >
double-click Mid(), and in STFID=box type Mid([Geo_ID, 8, 11) > OK (which
extracts an 11-character string from Geo_ID starting at position 8 and creates
a new column in Attributes of Census Data to match STFID in Attributes of
Tracts).
How to join two parts of place names (e.g., Shasta with County) to make a
usable ID in order to join the table with another table: open table > create a
new field Name, Text, with sufficient width > Calculate Value > Yes >
[PLACENAME] & & [COUNTY]. There must be a space between the
quotation marks.

How to create new key fields to permit census joins: see Peters & McDonald,
Unlocking the Census, pages 64-72.

GWR & ArcGIS

How to prepare ArcGIS data for the stand-alone GWR program: (1) create
any new variables (i.e. fields), including X-Y centroids, in ArcMap; (2) check
for possible data errors (e.g., sum race categories to make sure that they
add up to the appropriate total); (3) in Excel delete the datas superfluous
fields; (4) for U.S. Census data keep the following fields: an ID field withou
text such as STFID, X-Y centroids, the GWR variables, and (if the model
requires) a statistical weighting variable; (5) save the reduced data set in
Excel with a .csv extension; and (6) enter the data into GWR.
o No field can contain text, so do not include, e.g., the U.S. Censuss
GEO_ID.
o For some reason, Excel works in converting the data for GWR but
StatTransfer seem not to work.

14

o If analyzing the data in a statistical program such as Stata, be sure to

sort the ID-variable before saving and reconverting the data for use in
GWR and ArcMap.
Use Bonferroni-type adjustments for significance values unless the analysis is
frankly exploratory.
GWR in Stata: east(varname)=lon (i.e. x), north(varname)=lat (i.e. y).
After converting the output coverage to a points-shapefile in ArcCatalogs
conversion wizard, spatially join the map-shapefile to the points layer.
How to Display a Reduced-Maps Data together with the Original Map?
o Union the reduced map and the original map, then export and save.
o In the unioned and saved map, create a new field for the variable in
question (e.g., PARM_7x as the counterpart to PARM_7, perhaps
field=double, scale=10, precision=4 [because, for some reason, these
seem to work best]).
o Select by Attributes the reduced maps spatial unit-data for the
variable in question, then Calculate Values for the new field from the
original field (e.g., for PARM_7X from PARM_7).
o Select by attributes the original maps spatial units that were not
included in the reduced map, then Calculate Values such as:
PARM_7X=9999 (or some other number that stands out clearly from
PARM_7s values).
o In the table of contents, double-click or right click 9999s color and
change to something neutral.
Add another data classification interval (e.g., from 7 to 8) to
compensate for the loss of an interval to 9999.
Edit the color ramp to compensate for the fact that a neutral
color replaced a strong upper or lower-end color.
o Symbolize the unioned map: Layer>Properties>Symbology>Format
Label>click 9999 and change to Not Analyzed (or something else
appropriate).
o Save the map: File>Save As
o Note: this procedure wont work with kriged maps.

DEM Sources
www.seamless.usgs.gov

Computing Centroids in ArcGIS


Whats a centroid?
Centroid: a polygons mean center which is based on the weighted average of
its x and y coordinates; a useful way to summarize the locations of a set of
points, particularly when used for comparative analysis.
On the uses of centroids in GIS, see http://www.gsd.harvard.edu/gis
/manual/vector/
Use centroids only if the features are roughly the same size and
shape (see, e.g., Mitchell, The ESRI Guide to GIS Analysis, vol. 2).

15

Computing centroids (see ArcMap Help: centroids):


Inspect the attribute table.
If the attribute table does not already have a column for the X and a column
for the Y coordinates, add these fields (type=double, precision=10,
scale=4).
The X and Y columns are initially populated with 0s.
Do the following for the X column:
o Right-click column.
o Click Calculate Values (outside of an edit session).
o Click Advanced.
o In top text box type the following (or load the CentroidsX_calc
formula from the course web site; click Load in the dialogue box):
Dim dblX As Double
Dim pArea As IArea
Set pArea = [Shape]
dblX = pArea.Centroid.X
o

In the bottom text box type the following:


dblx

Click OK

You can obtain the X-centroids formula here.


http://www.gsd.harvard.edu/gis/manual/vector/calcx.jpg

Repeat the formula for the Y column, changing the Xs to Ys.

The calculations have assigned centroid values to the X and Y columns.

From within the attribute table, click Options/Export (i.e. not from a layer
in the table of contents but from within the attribute table itself). Then list
the path and type a name for a newly created table containing the centroids.

In the table of contexts, click Source to display the centroids table.

Click Tools (not ArcToolBox!)>AddXY Data, and specify the projection of the
original data from which the centroids were derived. This will change the
centroids dots from one to two dimensional.

o Via Symbology for the centroids layer you can adjust the symbol size
and color, including to one-dimensional black dots (e.g., smaller size
may display better on map).

16

You might also like