One of the advantages of storing your data in a geodatabase is that you can define rules about how the data can be edited. You will define these rules by creating a new attribute domain for lateral diameters; creating subtypes for the Laterals feature class; and associating the new domain, existing domains, and default values with fields for each subtype.
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 A quick tour of subtypes and A quick tour of attribute domains.
Create an attribute domain
You will create a new coded value attribute domain. This new domain will describe a set of valid pipe diameters for your new Laterals feature class.
- In the Catalog window, right-click the Montgomery geodatabase and click Properties.
The Database Properties dialog box appears.
- Scroll down and click the Domains tab.
- Click the first empty field under Domain Name and type LatDiameter for the name of the new domain.
- In the Description field, type Valid diameters for water laterals.
- Under Domain Properties, click the drop-down arrow for the Field Type and click Float.
This defines the data type of the column to which the domain can be applied.
- Click the drop-down arrow for the Domain Type and click Coded Values.
- 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 Description 10
10"
8
8"
6
6"
4
4"
3
3"
2.25
2 1/4"
2
2"
1.5
1 1/2"
1.25
1 1/4"
1
1"
0.75
3/4"
-9
Unknown
- Click OK to close the Database Properties dialog box and apply your changes.
The domain has been added to the geodatabase.
You will now specify the properties of the domain. These properties include the type of field this domain can be associated with, the type of domain it is—range or coded value, the split and merge policies, and the valid values for the domain.
A range domain describes a valid range of numeric values, and a coded value domain describes a set of valid values. In this case, you will create a new coded value domain.
All domains also have split and merge policies. When a feature is split or merged, ArcGIS looks to these policies to determine the values for a particular attribute of the resulting feature or features.
Type the valid values, or codes, for the coded value domain, and provide a user-friendly description for each code. 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.
Create subtypes and associate default values and domains
Now you will create subtypes for the Laterals feature class and associate default values and domains with the fields for each subtype. By creating subtypes, not all the water lateral features need to have the same domains, default values, or (as you will see later in the tutorial) connectivity rules.
- Double-click the Water feature dataset in the Montgomery geodatabase to open it.
- Right-click the laterals feature class and click Properties.
The Feature Class Properties dialog box appears.
- Click the Subtypes tab.
- Click the Subtype Field drop-down arrow and click TYPECODE.
- Click the Description field next to subtype code 0 under Subtypes and type Unknown for its description.
- Under Default Values and Domains, click the Default Value field next to the H_CONFID field and type 0 for its default value.
- Type 0 for the default value of the DepthBuried and RecordedLength fields.
- For the WNM_TYPE and PWTYPE fields, type WUNKNOWN as the default values.
- Click the Default Value field next to the 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.
- Click the MATERIAL field and type DI for the default value.
- Click Material in the Domain drop-down list for the MATERIAL field.
- Add the following subtypes:
Subtype code Description 1
Hydrant laterals
2
Fire laterals
3
Service laterals
- For all three new subtypes, set the default values and domains for the DepthBuried, RecordedLength, DIAMETER, and MATERIAL fields 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.
- Click the Default Subtype drop-down arrow and click Service laterals to set it as the default subtype.
- Click OK.
You will now specify the subtype field for this feature class. The subtype field contains the values that identify the subtype to which a particular feature belongs.
You will now add subtype codes and their descriptions.
When you add a new subtype, you assign default values and domains to some of its fields.
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.
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.