Building A Geodatabase Tutorial
Building A Geodatabase Tutorial
Geodatabase Tutorial
Table of Contents
A quick tour of the Building a geodatabase tutorial Exercise 1: Organizing your data in the Catalog . . . . . . . . . . . . . . . . . . . . . 3 . . . . . . . . . . . . . . . . . . . . . . 4
Exercise 2: Importing data into your geodatabase . . . . . . . . . . . . . . . . . . . . . . 6 Exercise 3: Creating subtypes and attribute domains Exercise 4: Creating relationships between objects Exercise 5: Building a geometric network . . . . . . . . . . . . . . . . . . . . 9 . . . . . . . . . . . . . . . . . . . . . 14
. . . . . . . . . . . . . . . . . . . . . . . . . 17
Exercise 6: Creating annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Exercise 7: Creating layers for your geodatabase data . . . . . . . . . . . . . . . . . . . . 27 Exercise 8: Creating a topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Geodatabase Tutorial
Geodatabase Tutorial
Connecting to data
In the Catalog, data is accessed through folder or database connections. Database connections are used to access ArcSDE geodatabases. This tutorial uses file geodatabases. File geodatabases are accessed through folder connections. Other data you can access through folder connections includes personal geodatabases, shapefiles, and coverages. When you look in a folder connection, you can quickly see the folders and data sources it contains. You will now begin organizing your data by creating a folder connection to it in ArcCatalog. Steps: 1. 2. 3. 4. Start ArcCatalog by clicking Start > All Programs > ArcGIS > ArcCatalog 10. Click the Connect To Folder button on the ArcCatalog Standard toolbar. This opens the Connect to Folder dialog box. Navigate to the BuildingaGeodatabase folder on the local drive where you installed the tutorial data. Click OK on the Connect to Folder dialog box to establish a folder connection.
Your new folder connection is now listed in the Catalog tree. Now you can access all the data needed for the tutorial through that connection.
5.
Geodatabase Tutorial
geodatabase. In the next part of this exercise, you will import this table into the geodatabase and create relationships between the parcels and their owners. Now that you have found and organized your data in ArcCatalog, you are ready to start the first task in the tutorialimporting data into the geodatabase.
Geodatabase Tutorial
Importing a coverage
Steps: 1. In ArcCatalog, right-click the Water feature dataset in the Montgomery geodatabase, point to Import, then click Feature Class (multiple). This tool is used to specify your input coverage, output geodatabase, and output feature class. Because you opened this tool by right-clicking a feature dataset, the output geodatabase, Montgomery, and feature dataset, Water, are already filled in for you. There are several ways to set the input and output datasets. You can also drag a dataset or datasets from the ArcCatalog tree or Contents tab and drop them on the text box. Alternatively, you can click the Browse button to open the ArcCatalog minibrowser and navigate to your dataset or type the full path name to the dataset in the text box. 2. 3. Click the Browse button, navigate to the arc feature class in the laterals coverage, and click Add. Click OK to run the Feature Class To Geodatabase (multiple) tool. While the tool is running, a progress bar appears in the lower right corner of ArcCatalog. When the tool completes, a pop-up message appears. You can click this to open the Results pane to see any messages that were generated while running the tool. The laterals_arc feature class is now in the Water feature dataset. 4. 5. 6. In the ArcCatalog tree, navigate to and click the laterals_arc feature class. Press the F2 key, then type Laterals to rename the feature class. Click the Preview tab to see the features.
Geodatabase Tutorial
1. 2. 3. 4. 5. 6.
Right-click the Laterals feature class in the Water feature dataset and click Properties. Click the General tab. Type Water laterals in the Alias text box. Click the Fields tab. Click the OBJECTID field and type Feature identifier for its alias. Repeat this process to assign aliases to the following fields:
Field Shape DEPTH_BURI RECORDED_L FACILITY_I DATE_INSTA TYPECODE Alias Geometry field Depth buried Recorded length Facility identifier Installation date Subtype code
7.
When you finish adding all the aliases, click OK to close the Feature Class Properties dialog box.
Now that you have imported the Laterals feature class into the geodatabase and added some aliases, you are ready to import the owner.dat INFO table.
Geodatabase Tutorial
10.
Click OK.
The data in the laterals coverage and owners.dat INFO table is now in the Montgomery geodatabase. Now you can take advantage of the geodatabase by applying behavior to your data. You will begin this task by creating subtypes and attribute domains. See Exercise 3: Creating subtypes and attribute domains.
Geodatabase Tutorial
Attribute domains are rules that describe the legal values of a field type. Multiple feature classes and tables can share attribute domains stored in the database. However, not all the objects in a feature class or table need to share the same attribute domains. For example, in a water network, suppose that only hydrant water laterals can have a pressure between 40 and 100 psi, while service water laterals can have a pressure between 50 and 75 psi. You would use an attribute domain to enforce this restriction. To implement this kind of validation rule, you do not have to create separate feature classes for hydrant and service water laterals, but you would want to distinguish these types of water laterals from each other to establish a separate set of domains and default values. You can do this using subtypes. To learn more about subtypes and attribute domains, see An quick tour of subtypes and A quick tour of attribute domains.
Geodatabase Tutorial
Type the valid values, or codes, for the coded value domain, and for each code, you will provide a user-friendly description. As you will see later in the tutorial, ArcMap uses the user-friendly description, not the code, for values of fields that have coded value domains associated with them. 6. 7. 8. Click the first empty field in the Code column under Coded Values: and type 13. Click the Description field beside it and type 13" for the code's description. Add the following coded values to the list:
Code 10 8 6 4 3 2.25 2 1.5 1.25 1 0.75 -9 Description 10" 8" 6" 4" 3" 2 1/4" 2" 1 1/2" 1 1/4" 1 3/4" Unknown
9.
Click OK to close the Database Properties dialog box. This domain has been added to the geodatabase.
10
Geodatabase Tutorial
6.
Under Default Values and Domains, click the Default Value field next to the H_CONFID field and type 0 for its default value.
7. 8. 9. 10.
Type 0 for the default value of the DEPTH_BURI and RECORDED_L fields. For the WNM_TYPE and PWTYPE fields, type WUNKNOWN as the default values. Click the Default Value field next to DIAMETER field and type 8 for the default value. Click the Domain drop-down list for the DIAMETER field and click LatDiameter to set it as the default attribute domain for the Unknown subtype.
11
Geodatabase Tutorial
11. 12.
Click the MATERIAL field and type DI for the default value. Click Material in the Domain drop-down list for the MATERIAL field.
13.
12
Geodatabase Tutorial
2 3
14.
Set the default values and domains for the DEPTH_BURI, RECORDED_L, DIAMETER, and MATERIAL fields for each of these new subtypes the same as you did for the Unknown subtype. For the Hydrant laterals subtype, set the WNM_TYPE and PWTYPE fields to WHYDLIN. For the Fire laterals subtype, set the default values of the WNM_TYPE and PWTYPE fields to WFIRELIN. For the Service laterals subtype, set the default values of the WNM_TYPE and PWTYPE fields to WSERVICE. When adding new features to a feature class with subtypes in the ArcMap editing environment, if you don't specify a particular subtype, the new feature will be assigned the default subtype. Once you have added all the subtypes for this feature class, you can set the default subtype from those you entered.
18.
Click the Default Subtype drop-down arrow and click Service laterals to set it as the default subtype.
19.
Click OK.
You have now added behavior to the geodatabase by adding domains and creating subtypes. Now you will add some additional behavior to the geodatabase by creating relationships. See Exercise 4: Creating relationships between objects.
13
Geodatabase Tutorial
6.
Click Next. The next panel is used to specify the type of relationship class you are creating. You are creating a simple relationship class, since owners and parcels can exist in the database independently of each other. You can, therefore, accept the default typeSimple (peer to peer) relationship.
7.
Click Next.
14
Geodatabase Tutorial
You must now specify the path labels and the message notification direction. The forward path label describes the relationship as it is navigated from the origin class to the destination classin this case, from Owners to Parcels. The backward path label describes the relationship when navigated in the other directionfrom Parcels to Owners. The message notification direction describes how messages are passed between related objects. Message notification is not required for this relationship class; therefore, you can accept the default of None. 8. 9. Type owns for the forward path label. Type is owned by for the backward path label.
10.
Click Next. You will now specify the cardinality of the relationship. The cardinality describes the possible number of objects in the destination feature class or table that can be related to an object in the origin feature class or table.
11. 12.
Click 1-M (one-to-many) to specify that one owner can own many parcels. Click Next. You must now specify whether your new relationship class will have attributes. In this example, the ParcelOwners relationship class does not require attributes, which is the default.
13.
Click Next. The next step is to specify the primary key in the origin table (Owners) and the embedded foreign key field in the destination feature class (Parcels). Owners and Parcels that have the same value in these fields will be related to each other.
14.
Click the first drop-down arrow under Select the primary key field in the origin table/feature class and click PROPERTY_ID.
15
Geodatabase Tutorial
15.
Click the second drop-down arrow on the dialog box and click PROPERTY_I for the embedded foreign key in the destination feature class.
Click Next. A summary page appears. Review the summary page to make sure the information is correct. Click Finish.
You have now added a second kind of behavior to the geodatabaserelationships. Next, you will continue to add behavior to the geodatabase by creating a geometric network and defining connectivity rules. See Exercise 5: Building a geometric network.
16
Geodatabase Tutorial
5. 6. 7. 8.
9.
Click Next. You must now select which feature classes in the feature dataset will participate in the geometric network
10.
Click Select All. All the feature classes in the list will participate in the network.
17
Geodatabase Tutorial
11.
Click Next. The option to exclude features with certain attributes makes it easier to manage the state of parts of the network if you need to drop the network and rebuild it after you have been working with it for awhile. On the next panel, you will opt not to exclude features.
12.
Click No, so that all features will participate in the geometric network.
13.
Click Next. On the next dialog box, you must specify which line classes will become complex edge feature classes in the geometric network. Complex edge features are not split into two features by the connection of another feature along their length; thus, they are useful for modeling water mains, which may have multiple laterals connected to them. By default, all line feature classes are simple edge feature classes. On the same dialog box, you must specify which, if any, of the junction feature classes can act as sources and sinks in the network. Sources and sinks are used to determine the flow direction in the network.
14. 15.
In the row for the Distribmains, click Simple edge under the Role column. Choose Complex edge from the list. This changes the role for the Distribmains feature class from a simple edge to a complex edge.
18
Geodatabase Tutorial
16. 17.
In the row for the Tanks feature class, click the drop-down menu under Sources & Sinks, then click Yes. In the row for Transmains, click Simple edge under the Role column, then choose Complex edge from the list. This changes the role for the Transmains feature class from a simple edge to a complex edge.
18.
Click Next. Now you can assign network weights. A network weight describes the cost of traversing an element in the logical network, such as the drop in pressure as water flows through a pipe.
19.
This geometric network does not require weights, which is the default, so click Next.
Clicking Next opens a summary page. 20. Click Finish after you review the summary page. A progress indicator appears displaying the progress for each stage of the network-building process. You will receive an error message indicating the network built, but with errors.
19
Geodatabase Tutorial
Click OK to close the message box. You can see what errors occurred while building the geometric network by previewing the WaterNet_BUILDERR table. Click the WaterNet_BUILDERR table in the Catalog tree and click the Preview tab to view the entries in this table. Two records are displayed. Tip: If you received more than two errors, delete the geometric network and repeat the steps to create it again. Be sure you correctly complete all the steps in this exercise to create the geometric network. If you still have more than two errors, it could be that you did not complete the preceding 5 exercises. This tutorial is cumulative; you must complete the preceding exercises before doing this one.
Next, you will establish connectivity rules for your water network.
2.
20
Geodatabase Tutorial
5.
Check Hydrants in the Subtypes in the network list. You should also specify that when you create a hydrant lateral, if an end of the lateral is not connected to another edge or junction, then a hydrant is placed at that end.
6. 7.
Click the plus sign next to Hydrants in the Subtypes in the network list. The Hydrants subtype is expanded. Right-click Hydrants under the Hydrants subtype and click Set as Default. A blue D appears next to the hydrant subtype, indicating that it is the default junction for this edge subtype. You will now create a new edgeedge rule, which states that hydrant laterals can connect to distribution mains through taps, tees, and saddles. The default junction for connections between hydrant laterals and distribution mains will be taps.
8. 9.
Click the plus sign next to Distribmains in the Subtypes in the network list to expand it. Check Distribmains, which appears under the Distribmains subtype. Because you have checked an edge in the network subtypes list, the list of junction subtypes in the network becomes active. In this list, you can specify which junction types hydrant laterals and distribution mains can connect through.
Click the plus sign to expand Fittings in the Junctions subtype list. Check Tap, Tee, and Saddle, in that order, under the Fittings junction subtype. Tap has a blue D next to it, indicating it is the default junction. Also in the Junctions subtype list, check WaterNet_Junctions, which is the generic, or default, network junction type. Click OK.
You have now added behavior to your geodatabase by defining connectivity rules. You would normally define many more connectivity rules for a network. However, for this tutorial, you only need to define the connectivity rules specified here. In Exercise 6: Creating annotation, you will create feature-linked annotation for your new hydrant lateral feature class.
21
Geodatabase Tutorial
3. 4. 5. 6. 7. 8.
Navigate to the location of the BuildingaGeodatabase tutorial folder, select the Montgomery geodatabase, then click Add. Click OK to open a new, empty map. Click the Catalog window button on the Standard toolbar to open the Catalog window.
Navigate to the Montgomery geodatabase in the Catalog window. Expand the Water feature dataset. Click the Laterals feature class, hold down the left mouse button, and drag the feature class from the Catalog window onto the ArcMap window. Because you created subtypes for the Laterals feature class, each subtype is automatically drawn with unique symbols. You will create different label classes for the subtypes.
9.
Right-click the Laterals feature class in the ArcMap table of contents and click Properties. The Layer Properties dialog box opens.
22
Geodatabase Tutorial
Click the Labels tab. Check the box to Label features in this layer. Click the Method drop-down arrow and click Define classes of features and label each class differently. Click Get Symbol Classes.
Now the layer has several label classes definedone for each subtype and one for other values. Leave the Layer Properties dialog box open; you will use it in the next section.
23
Geodatabase Tutorial
Click in the Expression box on the Label Expression dialog box and change the value in the If statement from 200 to 100. Click Verify. The expression is tested, and a sample is displayed. Click OK on the Label Expression Verification dialog box to close it. Click OK on the Label Expression dialog box. You have created an expression for the Hydrant laterals label class. Click Apply on the Layer Properties Layers tab to apply your changes.
Next, you will create expressions for the label classes of the other subtypes.
You have created labels for the different subtypes of laterals using the symbology classes in ArcMap to derive the label classes.
24
Geodatabase Tutorial
25
Geodatabase Tutorial
This will reduce the storage space needed in the geodatabase for the annotation. Each annotation feature will reference a symbology table in the geodatabase, rather than storing all its own symbology information. You will not be able to store graphics in this annotation feature class. The check boxes for the two feature-linked annotation editing behavior options are checked by default. New annotation will be created when new laterals are added, and existing annotation will move when laterals are moved or reshaped. 5. 6. Click OK to close the Annotation Feature Class Properties dialog box. Click Convert on the Convert Labels to Annotation dialog box. A message box appears showing the progress of the conversion process. The labels are converted to a set of annotation classes within a single annotation feature class. This feature class has been added to the ArcMap table of contents. A relationship class is also created that links the annotation to the laterals. To see this, click the Catalog tab in ArcMap to open the Catalog window. Right-click the Water feature dataset in the Montgomery geodatabase and click Refresh. A new Anno relationship class should display under the Water feature dataset. 7. Close ArcMap. Tip: You do not have to save the map, but you can if you want to do so. You have created an annotation feature class in the geodatabase. The annotation classes within it correspond to the subclasses of the laterals feature class. Some of these annotation classes have special symbology, as well as logic, to annotate certain features with extra information. When the Laterals feature class is edited in ArcMap, the corresponding annotation features will be created or modified using the symbology and annotation expression you defined.
26
Geodatabase Tutorial
4. 5.
27
Geodatabase Tutorial
14.
Your Water Laterals layer is complete. You can now create the annotation layer for the water laterals.
The new annotation layer is created. Since this layer points to an annotation feature class, the symbology is a property of the annotation, so it does not have to be set in the layer.
28
Geodatabase Tutorial
You have successfully imported coverage and INFO data into your geodatabase and created subtypes, rules, a geometric network, and feature-linked annotation. Now you will create a topology. See Exercise 8 Creating a topology.
29
Geodatabase Tutorial
Creating a topology
You will create the topology to regulate two types of spatial relationships in this dataset. The first is that parcels should not overlap, and the second is that parcels that have been classified as residential must fall within blocks that are also classified as residential. Steps: 1. 2. Start ArcCatalog by clicking Start > All Programs > ArcGIS > ArcCatalog 10. In the Catalog tree, navigate to the Landbase feature dataset in the Montgomery geodatabase. This dataset contains several feature classes. You will create a topology using two feature classesParcels and Blocks. 3. Right-click the Landbase feature class, point to New, then click Topology. The New Topology wizard starts. The first page provides a brief description of the wizard. 4. Click Next. The wizard presents a default name and cluster tolerance for the topology. You will accept the default name that the wizard provides. The default cluster tolerance is based on the XY tolerance of the Landbase dataset. 5. 6. 7. Type 0.01 to set the new cluster tolerance. Click Next. Check Blocks and Parcels. These feature classes will participate in the Landbase topology. One of the topology rules that you will create will concern the Parcels feature class, and the other will be between one subtype of Parcels and one subtype of Blocks; thus, both Blocks and Parcels feature classes must participate in the topology. If one of these feature classes were already participating in another topology or a geometric network, or if they were registered as versioned in a multiuser geodatabase, it would not appear in the list of available feature classes to add to this topology. 8. Click Next. The next page of the wizard allows you to set the number of topology ranks and the rank of each feature class in the topology.
30
Geodatabase Tutorial
Ranks allow you to ensure that more accurately collected features are not snapped to the position of less accurately collected ones when the topology is validated. For example, if you were including a feature class that was collected using a survey-grade Global Positioning System (GPS) unit and a feature class digitized from a 1:1,000,000-scale source map in the same topology, you would likely assign the GPS feature class a rank of 1 and the 1:1,000,000-scale source feature class a rank of 5. If you were to validate the topology, parts of features that fell within the cluster tolerance would snap together, with the less accurate ones moving to the location of the more accurate ones. The GPS features would not be moved to the position of the 1:1,000,000-scale features. You can assign up to 50 different ranks, with 1 being the highest rank. In this topology, you will assume that all the feature classes are based on equally accurate data, so you will not assign more than one rank. Parcels and Blocks have equivalent levels of accuracy, since the Blocks feature class was derived from the parcel features. 9. 10. 11. Type 1 for the number of ranks. Click Next. Click Add Rule. Topology rules allow you to define the permissible spatial relationships of features within and between feature classes that participate in the topology. Landownership parcels are usually not allowed to overlap each other. You will add a rule to prevent your parcel features from overlapping each other. 12. 13. 14. Click the Features of feature class drop-down arrow and click Parcels. Click the Rule drop-down arrow and click Must Not Overlap. Click OK. You have created a rule governing the topological relationship of features within the same feature class. Next you will create a topology rule governing the topological relationship of features in particular subtypes of two different feature classes. Specifically, you'll make sure that residential parcels are covered by or contained within blocks also designated as residential. 15. 16. Click Add Rule. Click the Features of feature class drop-down arrow, click the plus sign to expand Parcels, then click Residential. Residential is a subtype of the Parcels feature class that the planning department uses to represent parcels where people live. Click the Rule drop-down arrow and click Must Be Covered By. Click the Feature class drop-down arrow, click the plus sign to expand Blocks, then click Residential. Click OK. The topology rule is added to the list of rules for this topology. Click Next. Review the summary information for the topology to be sure it is correct.
31
Geodatabase Tutorial
22.
Click Finish. After the topology is created, you have the opportunity to validate it. You do not need to validate the topology immediately after creating it. Depending on your data and your workflow, it may make sense to assign different areas to data editors to validate and edit within ArcMap.
23.
Click No.
32