Lab Assignment 6 - University of Washington



|Lab Assignment 1 Winter 2011 |

|Forming the Geodatabase Schema |

Due Dates: 01/11/2011

| |Sections AA and AB: | |

Related Material:

| |Software: Windows 7 recommended (others might be problematic) | |

| |Datasets: | |

| | |P:\geog482\labAssignment1\data\*.* |

| |Deliverables: | |

| | |A completed answer sheet, answering all the questions provided below. |

Learning Objectives:

• Become acquainted with geodatabase schemas and elements

• Create a geodatabase and associated feature datasets

• Use different strategies for building schema

• Define a projection for a geodatabase

• Exercise WAGDA 1.0 portal capabilities for geospatial data access

• Define geodatabase behaviour based on domains and subtypes

• Work with integrity rules for selected domains.

• Work with SQL

• Exercise the Geodatabase Diagrammer

Introduction:

GIS is becoming an increasingly accessible and important tool for environmental management. The usefulness of GIS to organizations that deal with natural resource management is determined in large part by the availability, currency and quality of its spatial data resources. Learning how to store and manage spatial data is important for successful use of spatial data for sustainability management. Developing a Geodatabase will enable you to access, manage, manipulate, and analyze spatial data more efficiently and effectively. In this assignment you will begin creating a Personal Geodatabase for the WRIA09 (Water Resource Inventory Area 09) in King County, Washington State. Students will learn how to create a geodatabase, including the creation of new feature datasets, feature classes, domains, and subtypes.

Preparations:

First create a working folder to hold your data for the labs in this class. You have two options:

1. Create a folder in your personal H: drive for geography 482/582. If you choose this option your working folder will be accessible from anywhere in the department.

2. Create a new folder in C:\Temp folder and name it your “”. If you choose this option you must use the same computer next time you want to access your data.

Next create other folders within your working folder called “data” and “Lab1” respectively (i.e. H:\geog482\data\Lab1 or C:\Temp\\data\Lab1).

Copy the data folder from the P:\Geog482\labAssignment1 folder (or other data store provided) to your student folder (H:\geog482\data\Lab1). *** Always use ArcCatalog when moving ArcGIS files and folders to make sure all files are moved. We recommend creating a subfolder “output” in your folder for putting all results from this lab. *** The labAssignment1 folder contains the following folders and files (not an exclusive list):

labAssignment1\data\orthhabit

labAssignment1\data\Rating_codes

Creating a Geodatabase

GIS software can work with various spatial data formats such as shapefiles, rasters, CAD, Excel. ArcCatalog is a component of ArcGIS Desktop suite that you will use to manage spatial and attribute data. In this assignment you will create a Personal geodatabase and import and export both spatial and attribute data. Students can learn more about geodatabases at: .

Geodatabase elements

There are three fundamental data set types that can be stored in a geodatabase. You can store feature classes, tables, and raster datasets in geodatabase. The geodatabase stores the spatial and attribute data as tables within a single relational database environment. The file geodatabase can contain feature classes, feature datasets, rasters, and tables. You can also store behaviors such as topologies, geometric network and relationship classes. Students will explore the geodatabase elements used as a basis for creating such relationships, and then further explore the relationships in the following lab assignments.

[Question 1]: What is a feature dataset and what purpose does it serve? What is the difference between feature class and feature dataset? (Hint: Use the ArcGIS Help if not sure)

Geodatabase behavior

Data stored in a geodatabase have functionalities including subtypes, domains and default attribute values. Subtype is a function to categorize data into groups which can be very useful when editing data within one feature class. For example, for a road feature class, we can create a subtype of the roads based on the character of each road and we can assign a specific speed limit to each group. Attribute domains are rules that describe the valid value and constrain the values allowed in an attribute. A domain is a declaration of acceptable attribute data values. Using domains helps ensure data integrity by limiting the choice of values for a particular field. There are two types of attribute domains including coded value domains and range domains. Coded value domains define a set of acceptable values for an attribute. Range domains define a range of acceptable values for an attribute. Students can study more information about domain at: . A default attribute value is useful if you have data that contain the same attribute value for each feature.

[Question 2]: List 3 advantages of storing data in a geodatabase.

Review the King County data in WAGDA 1.0 and download spatial data:

It is time to begin the data acquisition process. Some necessary data for building the geodatabase will come from the Washington State Geospatial Data Archive (WAGDA) 1.0, housed at the UW Map Library (). It is important to note that WAGDA is not a data source. It is an archive that holds data from many different sources. Some of the data we will use in these assignments come from King County, which is a data source. Please review data in King County and other data sources in WAGDA.

1. Visit the WAGDA Website and click on “King County Data”

2. Use your UW Net ID to log-in and click on “I agree”, then you can proceed to downloading data you need

3. Click on the “All Data” data link and accept the terms

4. Review data in King County datasets (some datasets might be useful for your final project)

5. Go to Transportation Dataset and download “King County Street address” to your folder (H:\data\Lab1).

6. Then, download “King County Parcel Shapefile” from Property Dataset

7. Download “Streams and Rivers” from Hydrological Dataset

8. Download “WRIA boundaries derived from terrain data” from Hydrological Dataset

9. Open internet link to Department of Ecology website at and download “Water Resource Inventory Areas (WRIA)”

**Note: You downloaded WRIA data from both King County and Department of Ecology, we are going to look at these two data sets later**

10. The .zip files are archives containing several files that contain ArcGIS shapefile data sets. You will now need to “unzip” them before ArcGIS can use them.

Create and populate a geodatabase:

Now you will use ArcCatalog to create a new geodatabase in your H:\data folder. This geodatabase will hold your geospatial data and supplementary tables for this assignment.

11. Open ArcCatalog and link to H:\data.

12. In the left column, right click on your Lab1 folder. Then, click on NEW ( Personal Geodatabase, and change the name to “WRIA9.mdb”. This will be the place you will put all data that you find and create for this assignment.

This time students will need to create the feature datasets to associate various features classes of your data. Feature datasets are containers within a personal geodatabase specially designed to hold GIS layer data. As such, they must be assigned a spatial coordinate system, and all feature classes within them must use the same coordinate system. You will create five feature datasets within your geodatabase including DrainageAreas, HydroNetwork, RoadNetwork, Landuse, and Habitats.

13. To create the first dataset, right click on the WRIA9.mdb and choose NEW ( Feature Dataset. Name it “DrainageAreas”. For the time being we will ignore the Spatial Reference. Set it to “Unknown” coordinate system. But it is crucial to our geodatabase, so we will come back to it very soon. Press next to continue. Accept all default in X, Y, Z and M tolerance and click “Finish”.

14. Now you have “DrainageAreas” feature dataset (with no data in it) in WRIA9 geodatabase. Next, you need to continue add the other four feature datasets (HydroNetwork, RoadNetwork, Landuse, and Habitats) to by using the same technique

Project the data:

Before we add feature classes to the geodatabase, the feature datasets must be predefined with a particular coordinate system. All the feature classes added to the feature datasets therefore must have the same spatial coordinate system. This ensures consistency in spatial reference and allows all the layers to overlay properly. If you do not set the coordinate systems properly, your maps will never overlay appropriately.

15. In ArcCatalog, right click on the “HydroNetwork” feature dataset and choose “Properties”.

16. Under XY Coordinate System, press “Import” and add wtrcrs.shp. This sets the spatial reference of “HydroNetwork” to be identical to that of the wtrcrs.shp. Set the Spatial reference for each of the other four feature datasets to be the same as the “HydroNetwork” feature dataset. When you are done, all of your feature datasets will have the same spatial reference system, ensuring they will all function properly together.

[Question 3]: What is the XY coordinate system of the feature datasets?

Import data to the geodatabase:

This step imports spatial, attribute, and raster data into your geodatabase.

17. In ArcCatalog, right click on the “DrainageArea” feature dataset in your Lab1 geodatabase. Choose Import(Feature class (single)

18. In the dialog, set the Input Features to “topo_wria.shp” from your folder (H:\data\Lab1). (You should have just unzipped this shapefile before you do this process.)

19. Set Output Location to the “DrainageAreas” feature dataset. (You may have to click on the browse icon and navigate to the feature dataset.)

20. Set the Output Feature Class Name to “WRIA_King” . Do not change the other items in the dialog. Press OK

21. Repeat this process for the other four shapefiles (WRIA_polygon, parcel.shp, st_address,shp, wtrcrs.shp) that you downloaded. Be sure to put them all in the appropriate positions. If not sure which shapfile goes to which dataset, go back to step 4 on page 3. In addition, please note: in step 19, the output is called WRIA_King. In this step, WRIA_polygon should be called…? See below at step 23.

22. *To import raster data, right click on wria9.mdb -> import -> Raster datasets, set the input rasters to the “orthohabit” from your folder (H:\data\Lab1). The output Geodatabase should be “WRIA9.mdb”. Then click OK

23. *To import the table file “rating_codes.xls”, do the same process as import raster data but change to import “Table (single)” instead. Use “rating_codes.xls” as an Input Rows, set the output location to “WAIR9.mdb” name the Output Table “rating_codes”, Click “OK”.

*Note that you cannot save a table and raster data within a feature dataset. However it is saved inside your geodatabase.

You now have a personal geodatabase with 5 feature datasets and five feature classes, one table and one raster data. This geodatabase represents the foundation of a data analysis project.

Extract the data to the WRIA 9:

In this class, we are going to focus only the area in WRIA09. Therefore, we need to select only area in WRIA9 and clip other feature classes by WRIA09 area.

24. Open the new ArcMap document and save name as “Lab1.mxd”, then add WRIA_King and WRIA_Eco (see step 8 and 20) to TOC,

25. Open ArcToolbox ( Analysis Tools ( extract ( Select and set as the following:

a. Input Features: WRIA_King

b. Output Feature Class: …Lab1.mdb\DrainageAreas\WRIA9_King_select

c. SQL Expression: [WRIA_NO] = 9

d. Click “OK”

26. Do the same process to select WRIA9 area from WRIA_Eco feature class, and set in the Select Tool as the following:

a. Input Features: WRIA_Eco

b. Output Feature Class: …Lab1.mdb\DrainageAreas\WRIA9_Eco_select

c. SQL Expression: [WRIA_NR] = 9

d. Click “OK”

27. Add WRIA9_King and WRIA9_Eco feature classes to TOC (if they are not automatically added), explore both feature classes and find the difference between this two data.

[Question 4]: What are the differences between WRIA9 data from King County and Department of Ecology (DOE)? What should be the reason to explain why they are different? Hint: Think about the way to create data and the purpose of the data within each organization.

For this Lab, we will use WRIA9 data from King County (WRIA9_King). In TOC, remove all feature classes except WRIA9_King_select. Now, it is time to clip Roads feature class

28. Open ArcToolbox ( Analysis Tools ( Extract ( Clip (set ‘Clip’ window as the following)

a. Input Feature: Roads feature class

b. Clip Features: WRIA9_King feature class

c. Output Feature Class: WRIA9_Roads

d. Click OK

Now we have roads data in the WRIA9 area, we will use this data to create subtype later.

Close ArcMap.

Create a new feature class:

Now, we will learn how to create a new feature class. We would like to create the

wetland habitat areas in WRIA9 and then we will create domain for this new feature class.

29. In ArcCatalog right click on the Habitat feature dataset that you just created, and select New ( Feature Class

30. Name this feature class as “wetland_habitat” and select of features as “Polygon Features”. We don’t need to set coordinate M and Z values, click Next

31. Add two fields to the wetland_habitat feature class including

a. ‘Basin’ field with Data Type: Text and Length: 20

b. ‘Rating’ field with Data Type: Double and Length: 30

32. Then Click Finish

Now, we have a new feature class in the habitat feature dataset. Next we will set a domain for this feature class.

Geodatabase Domain:

Another useful tool for attribute value validation is using a geodatabase domain. They can be simple as set values for an attribute field like Yes/No or a range from 0 to 100 or they can be complex as in a list of vegetation species. You are going to learn how to create a geodatabase domain from the table stored in goedatabase.

33. Open ArcMap and add the new feature class “wetland_habitat” to TOC in ArcMap (there is no spatial data appearing because this feature doesn’t have any features within this file yet, you can also check the feature class table; there is no data in the table)

34. In ArcToolbox, click on Data Management Tools ( Domains ( Table To Domain, and set in the “Table to Domain” window as the following:

a. Input: rating_codes

b. Code Field: Rating_codes

c. Description Field: Descriptions

d. Input Workspace:wria9.mdb

e. Domain Name: Rating_codes

f. Domain Description: Description

g. Update Option: Append

h. Click OK

35. Close ArcMap. In ArcCatalog right click on WRIA.mdb and open the properties. Check if the new domain you created is listed in the Domain Tab.

36. To apply the geodatabase domain to a field, open the Feature Class Properties for the wetland_habitat feature class by right click on it. In the Fields tab, select the Rating field and set the Domain in the Field Properties to the Rating_codes

Now, you finished adding Domain to the wetland_habitat feature class. Next, we are going to set a default value to this feature class.

Set a default value:

Now, we will learn how to set a default value in the wetland_habitat feature class. This will automatically populate attribute values when digitizing new features. Note: if there are already values in the field you apply a default value to they will not change.

37. In ArcCatalog right click on the wetland_habitat feature class and open the properties. In the fields tab select the Basin field and enter in a Default Value of “Green River” under the Field Properties.

At this point in time, you have set Geodatabase Domain and Default Values, next we will start to digitize wetland-habitat areas in WRIA9.

[Question 5]: In your own words, describe the concept of “domain” within the geodatabase schema? What are the benefits when you use geodatabase domains?

Digitizing:

The data have been setup to populate a wetland_habitat feature class and apply geodatabase beheavior. You are now going to digitize wetland-habitat areas using a small example part of orthophoto in WRIA9 area.

38. Open ArcMap and add orthhabit raster file (from the course web page) to TOC in AcrMap. Display only Wetland_habitat feature class and orthhabit raster data. Students will see only raster data.

39. Open Editor tool bar (View ( Toolbars ( Editor), then click on Editor drop down menu and click “Start Editing”

40. On the editor tool bar, set Target to wetland_habitat feature class, set Task to Create New Feature, then click on Attribute Editor box . It will be blank right now because nothing is selected. Move it so that it does not block the view of the map.

41. Click on the Sketch tool icon , and start digitizing wetland-habitat by clicking around the two big green areas (double click when you finish digitizing in each polygon) as the below example image.

42. Examine the attributes of the new feature in the Attribute Editor. Notice that the default of Basin field is automatically entered into the field.

43. In the Rating field, you set it with the Rating_codes Domain. You can click dropdown to select the rating for these wetland-habitat polygons. Select ‘Unique/outstanding wetland’ for the big polygon and select ‘Low concern’ for the small polygon as shown in the below figure.

44. Stop editing and save the edits.

Now that we have finished entering wetland-habitat, you now have a new feature class that you just created together with attribute properties: Domain and Default Value.

[Question 6]: List and describe 2 other domains and default value that you could create for your geodatabase. Hint: think of something related to the wetland-habitat, streams, road, or land parcels.

Create a subtype:

Subtypes are used to group data in a feature class after which you can apply behavior to these groups. To create a subtype, an integer format is required to store the information. Since this field does not exist you will create in and then populate it based on the group. In this section, suppose the Department of Ecology would like to study the different contributions of surface water runoff with pollution from different types of roads. Three groups of roads were set for this purpose: 1) Highways, 2) Arterial/Collector Roads, and 3) Residential Side Streets. DOE categorizes Freeways as Highways (H); Collectors (C), Minor Streets (M), and Primary Streets as Arterial/Collector Roads; and Local Streets (L) as Residential Side Streets. We will create a subtype in this geodatabase to categorize WRIA9_Roads feature class. You can explore the metadata for a Roads feature class the link below:

(Metadata of st_street.shp)

45. Close ArcMap. In AcrCatalog right click on the WRIA9_Roads feature class in RoadNetwork feature dataset and click on properties. Select the Fields tab and add a short integer field called “categories” (If it does not allow you to add/edit, just save AcrMap document and close the program, then reopen when needed.)

46. Open ArcMap and add WRIA9_Roads feature class and open attribute table, using Select by Attribute from the main menu and compose a Structured Query Language (SQL) statement to select a unique attribute in KC_FCC Field.

47. First, you are going to check which roads is no value in the “KC_FCC” field.

SQL statement should look like the following: [KC_FCC] = ' '

48. In the Attribute Table, choose the option to show only the selected features. You will see that there is a one feature that has no value in KC_FCC field, therefore open Editor and put “L” in KC_FCC field to represent a Local Street. Then, Clear selection.

49. Now, create SQL statement again as [KC_FCC] = 'F'

50. In the Attribute Table, choose the option to show only the selected features and right click on the Categories field and use the Field Calculator to set the value to “1”.

51. Repeat new Select by Attribute with the SQL statement: [KC_FCC] = 'M' OR [KC_FCC] = 'C' OR [KC_FCC] = 'P'

52. Right click on the Categories field and use the Field Calculator to set the value to “2”.

53. Repeat new Select by Attribute with the SQL statement: [KC_FCC] = 'L'

54. Right click on the Categories field and use the Field Calculator to set the value to “3”. Close ArcMap.

55. In ArcCatalog right click on the WRIA9_Roads feature class to open its properties and select Subtype tab. Select the Categories field in the subtype field dropdown. Under Subtypes enter the code and description for each category as in the flowing figure.

56. Open WRIA9_Roads feature class in ArcMap and open the attribute table, then check to Categories field

[Question 7]: What happened with the Categories field? In the context of the geodatabase you are creating, describe other two examples of how/where a subtype can be used.

Geodatabase Schema

A geodatabase schema defines the physical structure of the geodatabase along with the rules, relationships, and properties of each dataset in the geodatabase. Defining and implementing a schema for a geodatabase is an important task that often requires prototyping and testing of a proposed design. Testing will help you to develop a robust, working system implementation.

At this time in this assignment we use ArcGIS Diagrammer 9.2/9.3 to view a geodatabase schema. ArcGIS Diagrammer is a tool for creating/viewing schema information.

If you are running your own computer (i.e. you are allowed to down and install software)

57. Download ArcGIS Diagrammer 10 from here: and follow the instructions to install this program

58. In ArcCatalog, right click on the WRIA9.mdb ( Export ( XML Workspace Document, export only schema and name WRIA9.xml

59. Open ArcGIS Diagrammer program and open WRIA9.xml file that you just created, the schema diagram will show up, you can examine the detail of this schema

If you are in the UW Geography Labs…

60. In ArcCatalog, right click on the WRIA9.mdb ( Export ( XML Workspace Document, export only schema and name WRIA9.xml

61. Open ArcGIS Diagrammer program and open WRIA9.xml file that you just created, the schema diagram will show up, you can examine the detail of this schema

[Question 8]: Provide a screenshot of the schema diagram of WRIA9 geodatabase

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download