Using ArcGIS Desktop
You rst create a domain and enter the codes and descriptions, or specify the numeric range. A coded value domain
can apply to any type of attributetext, numeric, date, and so on. The domain type must match the data type youre
creating the domain for (if the eld is integer, the domain type must also be integer).
Enter the name
and description
Click in the box to
select the eld type
Enter the
minimum and
maximum values
for the range
To create a domain, right-click
the geodatabase in the Catalog
tree and click Properties. Select
the Domains tab on the Database
Properties dialog box.
Enter the code
values and
descriptions
Dening a code domainselect Coded
Values in the Domain Type box.
Dening a range domainselect Range in the
Domain Type box.
You then associate the domain with a eld in one or more feature classes or tables in the geodatabase.
Click anywhere in the
row to select the eld
Click this box to select
the domain from the list
After creating a domain, associate it with a eld by
accessing the properties for the feature class or
table. Right-click the feature class in the Catalog
tree, click Properties, and select the Fields tab.
120
2 Geographic Data Management
Domains are created at the geodatabase level (for the entire geodatabase rather than for a feature dataset or individual
feature class) so they can be assigned to any of the feature classes or tables in the geodatabase. For example, a single
paving type domain could be assigned to both a Paving_type attribute in a highways feature class and a Surface_type
attribute in a streets feature class. Domains are managed using the Domains property page, which can be accessed
from the geodatabases properties dialog box, or from the Feature Class or Table Properties dialog box. The Domains
property page can be used to delete an attribute domain from the geodatabase or modify an existing domain.
Code domains constrain the values you can enter when editing attributes in ArcMapa drop-down menu lets you
choose from the valid attribute values. A range domain doesnt constrain the value that can be entered, but when you
validate your edits, any values that are outside the range will generate a warning so you can x the error (see Checking
your data for errors in Chapter 3).
Without the domain, values have to be typed
in. Not only does the domain save time, it
also helps prevent data entry errors.
When editing a eld with a code domain (in ArcMap), the attribute value is selected
from a drop-down list.
Using subtypes to assign default values and domains
Subtypes are based on categories or classes within a feature class or table, and are a way of assigning default values
and attribute domains without having to create separate feature classes or tables for each category. For example, in a
water network, it may be that transmission water mains can have a pressure between 40 and 100 psi, while distribution
water mains can have a pressure between 50 and 75 psi. Rather than creating separate feature classes for transmission
and distribution water mains, youd create two subtypestransmission mains and distribution mainswithin the
water mains feature class. You could then assign different range domains for the water pressure eld to each. Subtypes
can also be used to assign different topology rules to different types of features within a feature class (see the previous
section, Ensuring spatial data integrity).
The subtype for a feature in a feature class or a record in a table is determined by its subtype code value. The eld
youre using to dene subtypes must be short or long integer. If the values are currently stored as text attributes in
the table (as category values often are), youll need to add an integer eld to the table and assign a numeric code to
each category value (see Adding elds and calculating attribute values in Chapter 5). For example, if youre creating
subtypes for a parcel feature class using a general landuse code, and the categories are residential, non-residential,
and undeveloped, youd need to add a new eld to the feature class and assign an integer value to each feature based
on its landuse categorysay 0, 1, and 2, respectively. Youd then use this new eld to create the subtypes.
121