Attribute Data II
Attribute Data II
Fall 2002
Is cost per hectare related to land use type? Compare the two fields (i.e., scrolling through
the values) after sorting records.
Reposition and resize the Attributes of Land_use polygon table in the lower left of the screen for
the next exercise.
Editing records.
? Open the table landsuit.dbf.
Certain land uses are considered suitable for development purposes, whereas others are not.
Suitability is based on a number of criteria including cost to develop and environmental
conditions. Suppose that you discovered that the database contains an error and the landsuit.dbf
file should read:
Lu_code
100
200
300
400
500
700
Suitabil
Not suitable
Not suitable
Suitable
Suitable
Not suitable
Suitable
? Correct the landsuit.dbf table by using the Edit tool in the following manner:
1. Open the landsuit.dbf table and select "Start Editing" from Table Menu.
2. Edit the table (i.e., replace cell values) to match the values given above. Be sure to
hit the <Enter key after making changes to a cell value before continuing with next
step.
3. When done, save and finish editing by selecting "Save Edits" and "Stop Editing" from
Editor toolbar.
Recall that the landsuit.dbf table had been joined to the Attributes of Land_use polygon
table in the previous exercise. Examine the Attributes of Land_use polygon table to determine
whether the changes just made to the landsuit.dbf table are automatically reflected in the
Attributes of Land_use polygon table.
? Close the landsuit.dbf table only.
? Edit the ASCII file landuse.txt change Agriculture to Crops.
? Return to attrib.mxd and examine Attributes of Land_use polygon table.
Note that Crops has now replaced Agriculture in the Lu-name field. Look at the display in
the View window - what's happened? Open the Symbology Properties for Land_use layer and
reclassify on Lu-name using Unique Value.
? Save your document.
? Close all tables before continuing.
SIMPLE ANALYSES USING DATA IN TABLES
Although limited in scope, there are a number of simple descriptive statistics and
calculations you can do with data stored in ArcMAP tables. If the statistics go beyond the
capabilities of the ArcGIS software, you can export the table (all of the table or only selected
fields and records) from ArcMAP and do your analyses in a statistics package of your choice
(see EXPORTING DATA FROM A TABLE).
? Display only the Land_use layer.
What steps would you take to answer the following question:
What is the average cost (in dollars) for purchasing parcels (i.e., polygons) of land of
different land use types?
Hints:
Open the Attributes of Land_use polygon table. What are the fields?
Does the table contain the field that you need to answer this question? If yes, what field is
it? If no, what data do you need to calculate or add?
Calculating fields.
You will now create a new field, called Total_cost, in which you will calculate the cost
for each record as the area in hectares times the cost per hectare.
? Open the Attributes of Land_use polygon table and select "Add Field" from the Options
drop down menu.
Add a new field to the table named Total_cost, which is a float with width of 12
(precision or length of field) and 2 decimal places (add 2 next to scale in field properties).
? Start Editing from the Editor toolbar.
? Right click on Total_cost and select Calculate Values.
Write a logical expression that computes the total cost in dollars for each record.
The field Area is in square meters and Cost/ha is in hectares (1 hectare = 100 meters x
100 meters = 10,000 square meters). Click "OK" when done.
The Total_cost field in the table should now contain the appropriate cost values.
? Stop Editing the Attributes of Land_use polygon table.
? Display Total_cost field using the Symbology Properties.
Use a Graduated Color Legend Type.
? Display the Roads theme.
Assuming you must buy entire parcels and can not subdivide them, where is development
most costly? If parcels could be divided, where would development be most costly?
Calculate can perform a variety of operations including arithmetic expressions, combining
string (character) data contained in different fields, and replacing string data with new values.
Summarize data in a table.
At times you might want to summarize data contained within a field. You can do this for all
records in the table or for only selected records. Results from summary operations are stored in a
new table.
You will now create a summary table entitled sum_cost.dbf that contains the total costs in dollars
for polygons of different land uses contained within the Land_use polygon layer.
? Open the Attributes of Land_use polygon table if it is not already open.
? Select the field Lu-name as the grouping variable (i.e., highlight this field).
? Right click on field name and select Summarize.
A Summarize window pops up.
1. In the first line of this window enter the field name to
make the summary (Lu_name)
2. Select Total_cost as the Field for which you want
summary information.
3. Check Sum, Average, Variance, Minimum,
and Maximum as desired statistics.
4. Specify sum_cost.dbf as the output table and save it in
your j:\GIS\attribdata folder.
5. Click "OK" when done.
A new table is created called sum_cost.dbf that contains 6
records that correspond to the six land use categories. This table contains the statistical
data asked for in step 3.
? Add table to the document and open to view the statistics.
Another option to calculate some basic statistics is to select "Statistics" after right-clicking the
field name.
A window pops up that provides some
basic statistical information. These data,
however, are not stored in the same way as
when you created a summary table. Does
the sum value match any values from the
summary table sum_cost.dbf? (Reopen this
table if it is not already open.)
Why not?
Select only forest polygons in the Land_use theme (use Select by Attributes from the Options
menu in the table) and repeat the procedure to obtain statistics for the selected forest polygons.
Does this value match one of the records in the summary table? It should!
EXPORTING DATA FROM A TABLE
Data can be exported into a dBASE file, Personal Geodatabase file (e.g., INFO file), or a
text file using the "Export" command from the Table Options menu. To export only certain
fields, make only these fields visible. To export only certain records, select those records (e.g.,
by highlighting individually or by using the Select by Attributes option).
Exported data can then be used as tables in text documents (e.g., WordPerfect or WORD
documents), to create charts in other graphics programs (e.g., CricketGraph, SigmaPlot), or for
statistical analyses in other software programs (e.g., SAS, SYSTAT, Statistix, SPSS, etc.).
You will now export a table called cost.dbf that contains three fields (Area, Cost/ha, Total_cost)
and only land use records that are suitable for development from the Attributes of Land_use
polygon table.
? Select only records that are "Suitable for Development" in the Attributes of Land_use table.
? Make only the fields Area, Lu-name, Cost/ha, Total_cost visible in the Attributes of Land_use
polygon table (Hint: Go to Table Properties window by right clicking on table name in TOC).
The table should have only four columns.
? Select Data, "Export" after right-clicking on the table name (or Open table and select
Exporting tables is a very useful tool, since it allows you to transfer data from ArcMAP
to other software packages. For example, imagine you have been asked to develop a predictive
model that explains the number of bird (mammal or plant) species contained within countries
from your last assignment. How might you go about developing such a model? Which of the
data from your last assignment (i.e., which fields) might help predict (or explain) the number of
species within a country? (Don't be too concerned if you do not know about the type of statistical
model needed; it requires some background knowledge in multivariate statistics.) However, from
a technical standpoint, how can you prepare the data that you need from your assign1.mxd
project so that it can be exported for statistical analysis? Many of you will need to master this
skill for your final independent project.
Exercises:
1. Calculate a new field called Sqrt_Length in the Attributes of Road arc table that is the square
root of the Length.
2. Create a summary table of Length from the Attributes of Road arc table with Road_type as the
grouping variable. The table should include Sum_Length, Min_Length and Max_Length.
3. Export a text file from the Attributes of Road arc table that contains Road_type and Length.