EXERCISE 5
WORKING WITH ATTRIBUTE DATA
FOR/GGR 525


BE SURE TO SAVE YOUR WORK REGULARLY!!!

  When editing a layer in ArcMap, make sure you use the Save Edits option on the Editor toolbar to save edits as a separate process from saving your map.


EXERCISE 5A
EDITING AND UPDATING ATTRIBUTE DATA

INTRODUCTION

In this portion of the exercise the student will learn how to query a specific subset of records.

INSTRUCTIONS FOR COMPLETING THE EXERCISE

  1. Logon to the computer and start ArcMap.
  2. Either open the map you used in Exercise 4 or open a new map, adding the owner.lut and fwseneted polygon layers.
  3. Open owner.lut.
  4. Next you will learn how to select (or query) a subset of features from the owner.lut table.

 

  1. In the Attributes of owner.lut, click the Options pulldown menu, and choose Select By Attributes... 


  2. Using selection method "Create a new selection," select all rows having a value of Owner-code less than 300 (not federal government). Create new selection essentially clears the selection before performing a new selection. You can also do this from the Option pulldown menu. You can choose query values by double-clicking them in the windows (e.g. double-click "Owner-code" to put it into the query box below).


  3. Don't close the query window, but click Apply. You can also test the syntax of your query before applying by clicking Verify. The selected records should be highlighted in the table.

    This set of rows is now your "selected set". You may take some action on this set, for example, you could delete them or edit them (don't do this now, of course).

  4. In the Select By Attributes query window, add additional records to the "selected set" by choosing Method: Add to current selection. 

  5. Construct a query adding Owner-code 314 to the selected set. All rows in the table should now be selected.

  6. Now 'unselect' the City rows by choosing Method: Remove from current selection.


  7. You should now have everything but rows of Owner-code = City selected. What if you only want these City rows selected? You can change the "selected set" of data to those records other than the ones selected by swapping the records in the non-selected set and the selected set. To do this:
    1. Close the Select by Attributes window.
    2. In the Attributes of owner.lut window, click the Options pulldown menu and choose Switch Selection. Now only the City rows should be selected.
    3. Clear the selection by choosing Clear Selection in the Options pulldown menu.
  8. Exit ArcMap and logout or continue on to the next part of the exercise.

 


EXERCISE 5B
RELATING ATTRIBUTE DATA

PURPOSE

In this portion of the exercise you will learn how to relate the non-spatial attribute data in the owner.lut file to the spatial data in a feature attribute table (fwseneted). In ArcGIS, there are two ways to relate data in separate tables. The first method is called a Relate. A relate is an abstract action that initiates a relationship between the two tables, but neither table changes. It is particularly useful when there is a one-to-many or many-to-many relationship between the related data. The other method is a Join. A join is a concrete action in that the data from the joined table are appended to the original table. Joins are most useful with a one-to-one relation. The following exercises will demonstrate (hopefully) the difference.

INSTRUCTIONS FOR COMPLETING THE EXERCISE

1. Study the example of relating two files.

TEST.PAT                           TEST.CODE

TEST-ID   DATA1                    TEST-ID  DATA4     DATA5
   1      15.1                          3     BB         91
   2      14.7                          2     AA        158
   3      12.0                          1     AB        107
   4      22.6                          4     AC        146
   .       .                                   .          .
   .       .                                   .          .
   .       .............       .................          .
   .                   .       .                          .
   .                   .       .                          .
   .......TEST-ID    DATA1  DATA4       DATA5..............

             1       15.1     AB        107 
             2       14.7     AA        158
             3       12.0     BB         91
             4       22.6     AC        146

    Question - Which column was used as the field to relate the two files?

    Answer - TEST-ID

2. Perform a RELATE manually (by hand) on the two tables illustrated below.

 

  1. Examine the item definition of each file.

    TESTCOV.AAT
    FNODE# TNODE# LPOLY# RPOLY# LENGTH TESTCOV# TESTCOV-ID
    37 107 0 0 20.9 163 45
    105 154 0 0 12.7 164 46
    35 91 0 0 17.2 165 47

    TESTCOV.TABLE
    TESTCOV-ID NAME ORDER MEAN-WIDTH
    46 NORTH RIVER 3 345
    45 WEIR RIVER 3 767
    47 DUXBURY RIVER 2 201

  2. Manually join (relate) the two files based upon the item in common, write out the results of the operation, and hand-in to your lab instructor by next period.

    TESTCOV.TABLE will be "related" to TESTCOV.AAT. Items are "appended" to the RIGHT of the <coverage>-ID item, not "inserted."

3. Examine fwseneted polygon and owner.lut to determine how they should be related.

 

  1. In ArcCatalog, examine the fields and data in fwseneted polygon.
  2. Do the same for the fields and data in owner.lut.

    Question - What is the common item in the two files?

    Answer - The common item is Owner-code. This is why we made them the same. The fields must have the same configuration (type, width, etc) in order to relate to each other.

4. Temporarily relate the two files fwseneted polygon and owner.lut.

Question - Why do you want to relate these two files?

Answer - Because you want to "link" the spatial data in fwseneted polygon with the non-spatial attribute data in owner.lut.

  1. Open an ArcMap map that has fwseneted polygon and owner.lut added to the table of contents.
  2. Right mouse-click fwseneted polygon, choose the Joins and Relates pulldown and select Relates....

    It may take a few minutes for ArcMap to re-build the topology.

  3. Input the appropriate parameters to set up the relate and click OK.


  4. Look at the two tables in ArcMap. 

    Question: Did anything change? 

    Answer: Not in the tables!

  5. We have constructed a relate. However, we have not yet accessed it from a table. You can tell because if you select a row from either table, rows are NOT selected in the related table. To access the relate, activate the Attributes of Owner.lut window and highlight (select) the State ownership row by clicking on the far button (shown as an arrow here).


  6. From the Options pulldown menu choose Related Tables and select the owner:polygon relate. 


  7. You should now see the related rows (State ownership) selected in the related table (fwseneted polygon). This is an example of a many to one relationship (many features -  polygons - have one related attribute).



  8. Now that you have found all the polygons owned by the State, you could perform some function with them. However, there are some functions that are unable to access the related values. For example, you can't use them to label the fwseneted polygon layer. To demonstrate this, right mouse-click the layer and choose Properties.

  9. Choose the Labels tab in the Layer Properties window and look at the fields available to label polygons listed in the Label Field pulldown menu. The OWNERSHIP field is not available. Label the polygons using OWNER-CODE.



  10. Are these labels very informative? In order to have the values available for labeling (and other functions), you must "physically" join the attributes of the look up table to the feature attribute table. 


EXERCISE 5C
JOINING ATTRIBUTES TO COVERAGE FEATURES

PURPOSE

The purpose of this portion of the exercise is to demonstrate the use of the Join for permanently attaching attribute information (non-spatial data) to the feature attribute tables (spatial data). This would be useful particularly for tables who are related in a one to one relationship (one feature - in this case a polygon - has one related attribute).

INSTRUCTIONS FOR COMPLETING THE EXERCISE

1. You should have already examined the fwseneted polygon and owner.lut and performed a temporary RELATE command.

2. Start ArcMap and open the map with fwseneted polygon and owner.lut

3. Determine the appropriate parameters for each argument in the Join function.

 

  1. Right mouse-click  fwseneted polygon and from the Joins and Relates pulldown choose Join...
  2. In the first Join window you can either join attributes from a table to the coverage or  join attributes from a layer based on spatial location. We want to join attributes from a table.
  3. Choose the OWNER-CODE field in the first layer, the owner.lut as the join table, and OWNER-CODE as the join field.


4. Click OK and then open the fwseneted polygon table. You should see that all the fields from the owner.lut have been added to the fwseneted polygon table. Now you have the attributes connected to the table, which would allow you to use them for processes like labeling polygons based on the OWNERSHIP field values.

   

5. Label polygons based on the joined OWNERSHIP field values.

  1. Right mouse-click the fwseneted polygon layer in ArcMap and choose Properties. Click the Labels tab and choose the field you want to use for labeling (owner.lut OWNERSHIP).


  2. Click the Symbol... button and choose symbol values.


  3. Hopefully you will now see labels that are more informative (in the following graphic I have chosen the Country3 symbol, size 10).

6. Make a layout showing your polygons with the ownership labels, and hand it in to your TA.  

7.  Exit ArcMap. Clean up your workspace in ArcCatalog by deleting unwanted coverages and files. Exit ArcCatalog and logout.

 


Return Return to Class Home Page...