Docsity

Basic Database Operation Tools in ArcMap - Laboratory 5 | GEOG 579, Lab Reports of Geography

Toggle sidebar
bg1
Department of Geography and Geology
Eastern Michigan University
Geographic Information Systems
Lab 5
Basic Database Operation Tools in ArcMap
The purpose of this laboratory is to help you develop greater proficiency when working
with the Database Management System tools employed by ArcGIS 8.2. Data for this lab
are stored on \\Teach17\GIS_579\Database.
Topics Covered in this Lab
Joining Tables
Obtaining Summary Statistics
Database Queries
Performing calculations with the Field Calculator
Transforming the Value of Variables
Obtain Properties of Geographic Features
Creating Charts
Section 1. Accessing Data
1. Copy the Census Tract folder on \\Teach17\GIS_579\Database to the c-drive of
your computer. Use ArcCatalog to make a connection to this folder.
2. Open ArcMap and load the files called “c_tracts” and socio_ data into the Data
Frame.
Section 2. Joining Tables in ArcView
To join two tables in ArcView, the tables must have at least one field in common. The
field names can be different in the two tables, but the data type must be the same and the
field values must match. In this exercise, you will join the socio-economic data table that
you loaded into the project to the attribute table of the census tracts shapefile to. To join
the two tables:
1. Right click on the c_tract in the table of contents and select Joins and Relates |
Joins.
2. Fill in the dialog box appropriately and join the two tables. Note: The table on
which the join will be based on is the destination table. The table from which the
data is coming from is called the source table. Always sort out mentally which is
the source and destination tables.
3. Use the field called Tract90 in the attribute table of c_tract and the field called
Tracts in the socio_data table as the common fields on which to base the joins.
4. A join is a temporary action. If you want the tables to be permanently joined, then
you should create a new shapefile that contains the joined table. To do so, right
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Basic Database Operation Tools in ArcMap - Laboratory 5 | GEOG 579 and more Lab Reports Geography in PDF only on Docsity!

Department of Geography and Geology Eastern Michigan University Geographic Information Systems Lab 5 Basic Database Operation Toolsin ArcMap The purpose of this laboratory is to help you develop greater proficiency when working with the Database Management System tools employed by ArcGIS 8.2. Data for this lab are stored on \Teach17\GIS_579\Database. Topics Covered in this Lab Joining Tables Obtaining Summary Statistics Database Queries Performing calculations with the Field Calculator Transforming the Value of Variables Obtain Properties of Geographic Features Creating Charts Section 1. Accessing Data

  1. Copy the Census Tract folder on \Teach17\GIS_579\Database to the c-drive of your computer. Use ArcCatalog to make a connection to this folder.
  2. Open ArcMap and load the files called “c_tracts” and socio_ data into the Data Frame. Section 2. Joining Tables in ArcView To join two tables in ArcView, the tables must have at least one field in common. The field names can be different in the two tables, but the data type must be the same and the field values must match. In this exercise, you will join the socio-economic data table that you loaded into the project to the attribute table of the census tracts shapefile to. To join the two tables:
  3. Right click on the c_tract in the table of contents and select Joins and Relates | Joins.
  4. Fill in the dialog box appropriately and join the two tables. Note: The table on which the join will be based on is the destination table. The table from which the data is coming from is called the source table. Always sort out mentally which is the source and destination tables.
  5. Use the field called Tract90 in the attribute table of c_tract and the field called Tracts in the socio_data table as the common fields on which to base the joins.
  6. A join is a temporary action. If you want the tables to be permanently joined, then you should create a new shapefile that contains the joined table. To do so, right

click on the c_tract layer and select Data | Export Data and export the file so as to create a new shapefile. Add the new shapefile to the Data Frame. Also, you should examine the table of this new file. Section 3. Data Exploration and Obtaining Summary Statistics Return to the View, open the c_tract shapefile and display the data in the “Household” field. Display the data using the Natural Breaks, Equal Interval and Standard Deviation classification schemes. To do so:

  1. Right click on the shapefile’s name in the Table of Contents.
  2. Click on Properties | Symbology | Quantities | Graduated Color
  3. In the “Fields” frame near to Value, select “Household” as the field to map.
  4. In the “Classification” frame, click on Classify to select the classification method, i.e., Natural Breaks, Equal Interval, etc. You can also select the number of classes you want to place the data. Take a moment and familiarize yourself with this dialog box. Click Ok when you are finished. Task 1. Make either screen shots or layouts maps showing household distribution by census tracts using the three classification schemes. What differences do you notice in the mapped household distribution patterns when using the three classification schemes? Under what circumstances would you use each of the two classification schemes (See ArcMap Help Topics for information on the classification schemes. Submit both the maps and your written answer. Task 2. Open the attribute table of c_tracts and right click on the “Household” field. Click on Statistics. Make a screen shot of the message box that shows the basic statistics associated with the Household field, e.g., count, maximum and minimum number of households per census tract, the mean number of households, and the standard deviation? What is meant by standard deviation and what does the standard deviation tells you about this data set? ( Tip 1 : Click on Alt-Print Screen to make a copy of the message box that appears with the summary statistics. Open Microsoft Word and click on Paste to paste the message box you copied into the Word document).

“Pop1990” / “Area” <= 25 )

  1. Normally ArcMap evaluates a query from left to right, but expressions that you enclose in parentheses are evaluated first. For example, the query: (“Netvalue” > “Area” * “Price” + “Tax”) will be evaluated differently from: (“Netvalue” > “Area” * (“Price” + “Tax”)) See ArcMap Help Topics for more information on constructing syntaxes. Task 3. What census tracts that have more than 5000 persons and more than 700 college educated people Task 4. What census tracts have between 200 and 400 Hispanics? Can you figure out the syntax? (Print out layouts of your work. Note ArcMap only stores one layout to a Data Frame. You may have to create several Data Frame to contain the layouts). Section 5. Performing Calculations with the Field Calculator ArcMap comes with a powerful field calculator that allows you to perform mathematical calculations on the values in the attribute tables as well as on “Shapes” in the shapefile. Prior to performing calculations, you should create a new field to store the result of the calculations. This field should be capable of storing numeric data with the appropriate number of decimal places. To create a new field in a table:
    1. Click Options in the table in which you want to add the field.
    2. Click Add Field. (If the Add Field menu is “greyed” out, it is because the table is being edited. Click on Editing | Stop editing and then return to Options).
    3. Complete the dialog box.
    4. Type the name of the field.
    5. Click the Type dropdown arrow and click the field type.
    6. Set any other field properties.
    7. Click Ok. In order to perform a calculation, first select the field that will receive the results of the calculation, then click on the field name and select Calculate Values. Equations must be syntactically correct. Also, it is better to place the layer in editing mode before you perform calculations.

Task 5. Calculate the percentage of the total population in each census tract that are college graduates? (Submit a screen shot of a section of the table along with you SQL statement). Syntax: ([COLGGRAD] / [PERSONS]) * Task 6. Calculate the percentage of housing that is vacant in each census tract? Task 7. Calculate the population density in each of the census tracts. Population density is the number of individuals living in an area at a given time divided by the unit size of the area. Task 8. Estimate the growth in population in each census tract over the next five years assuming that average population growth rate is 1.5%. One formula for estimating population growth is:

Pt = P 0 (ert)

  • where Pt = Population at the future time; P 0 = population at the initial time; e is a constant, i.e., the of the natural logarithms (2.71828); r is the rate of population growth; and t is the number of time intervals. Tip. The exponential symbol is ^. Section 6. Transforming the Value of Variables For statistical, mapping, and visualization purposes it is often desirable to alter values of a field mathematically. Perhaps the commonest and most useful is the power function, but logarithms, roots, exponentials, and trigonometric functions can also be used. Task 9. Compute the logarithm of the values in the field named “Inc_5075”. Write down an instance in which you might want to use the logarithms of numbers?
  1. Start Editing the table.
  2. Clear any selection on the table so that the logarithm will be computed for all records.
  3. Create a new field for the logarithm. Name it LogIncome (We will be using base-10 logs.) Give it at least three decimal places (three or four is generally good enough for most logarithms).
  4. Use the field calculator to compute LogIncome. In the Field Calculator dialog's text box type [Inc_5075].Log(10)
  5. Press OK. Save your edits if the result looks good. Submit a screen shot showing part of the table that contains the LogIncome field.
  1. Overlay the original landmarks file on the new polygon file. Is the count accurate? You can change the color schemes to better observe the counts per polygon.
  2. Consult the handout named “Working with Tables”, pg 13- 14 for more information on spatial joins. Submit a layout of the new polygon showing distribution of landmarks by census tracts. Section 8. Obtain Properties of Geographic Features You can use Visual Basic for Applications (VBA) statements in the Field Calculator to obtain properties of geographic features in your project. Task 11. Use the field calculator to compute the area of each census tract, as well as the x,y coordinates of the centroid of each census tract. A centroid is a point near the center of a polygon. They can be used to assign labels to polygons or they may be used to “hang” attribute data for polygons.
  3. Open the C_tract attribute table.
  4. Create numeric fields [Area2], [X], and [Y]. Give them three decimal places each.
  5. Clear any selection on the table so that values will be computed for all features.
  6. Activate the [Area2] field you just created by pressing on its header in the Table document.
  7. Right click on the field name and click on Calculate Values.
  8. In the Field Calculator dialog, place a check near to Advanced.
  9. Enter the following VBA code in the Pre-Logic VBA Script Code window: Dim dblArea as double Dim pArea as IArea Set pArea = [Shape] dblArea = pArea.Area
  10. Click Ok. ArcMap will always return the values in terms of the map units.
  11. After checking your work, proceed immediately to compute the [X] values (the X coordinates of the "centers" of each feature)
  12. Activate the [X] field.
  13. In the Field Calculator -Logic VBA Script Code window, type Dim dblX As Double Dim pArea As IArea

Set pArea = [Shape] dblX = pArea.Centroid.X

  1. Type the variable dblX in the text box directly under the X field name.
  2. Click OK. (If you get an error message, uncheck Advanced in order to ensure that the previous code is completely removed.
  3. Repeat the same process and compute the y coordinates for the centroid. Section 9. Creating a Shapefile from Coordinates Stored in a Table Frequently, people gather geographic data as a set of x,y coordinates. For example, a GPS receiver gathers sequences of point coordinates. Surveyors usually report surveyed points in coordinate form or in range-bearing format. As a GIS technician, you may be required to convert a set of x,y coordinates stored in a table to a shapefile. This is a very straight forward operation in ArcGIS: Task 12. Convert the coordinates in the table below into a shapefile. To do so:
  4. Create a new table and enter the points coordinate (Open ArcMap Help Topics and type Table. Scroll to “creating” for instructions on how to create a new table).
  5. Save the table. Open the points table you just created.
  6. Return to the Data Frame and click on Tools | Add X,Y Data.
  7. Fill in the dialog box and click Ok.
  8. Print out and submit a screen shot or layout of your points theme. Coordinates ID X_Coord Y_Coord 1 38.4769 3. 2 38.6505 3. 3 38.5844 3. 4 38.7416 3. 5 38.6635 3.