Attribute domains are rules that describe the available values of a field type. They are used to constrain the values allowed in any particular attribute for a table or feature class. They provide a method for enforcing data integrity by limiting what can be placed on a field to a valid list or range of choices. If the features in a feature class or nonspatial objects in a table have been grouped into subtypes, you can assign different attribute domains to each of the subtypes. Whenever a domain is associated with an attribute field, only the values within that domain are valid for the field. In other words, the field will not accept a value that is not in that domain.
You can share attribute domains across feature classes, tables, and subtypes in a geodatabase. For example, a feature class for water mains and a feature class that stores water laterals can use the same domain for the ground surface type field.
Domains are created and edited within their own tabular-style view called the Domains view. Within the Domains view, you can view existing domains, edit their properties and values, and create domains.
In the image below, you can see the Domains view displaying some of the domains associated with the Campus Editing data model.
Each row in the view is an existing domain and they all share common properties such as a name, description, field type, domain type, and split and merge policies.
You can filter the domains listed in the view using the Filter Text text box on the Domains tab available with the Domains view. As you enter text, the view updates with only those domains that have matching text in the Domains view fields.
Review the following domain properties that are recorded when creating or modifying a domain.
When a domain is created in an enterprise geodatabase, the current connected user becomes the owner of the domain. Only the owner or the geodatabase administrator can modify the domain properties.
Name and description
When creating a domain, you specify a name that describes the parameter it governs. You cannot use the characters ' and `, a single quote and an apostrophe, when naming a domain. After a domain is created, the domain name is displayed in the domain drop-down menu when choosing a domain to associate with a given field in the fields view or subtypes view.
The description is a short sentence describing the purpose of the domain.
The field type is the type of attribute field with which the domain can be associated.
You can set the field type to any of the following:
- Short—Short integer (16-bit)
- Long—Long integer (32-bit)
- Big integer—Big integer (64-bit)
- Float—Single-precision (32-bit) floating-point number
- Double—Double-precision (64-bit) floating-point number
- Text (Coded domains only)—Alphanumeric characters
- Date—Date and time value
Domains on date field types support only whole second-based precision.
- Date only—Date values only, with no time value
- Time only—Time values only, with no date value
Time only is a linear data type, where time values are stored in a linear fashion and represent the hours, minutes, and seconds of a non-specific day. Valid time values start at 12:00:00 AM and end at 11:59:59 PM. If you need to split a domain over midnight, a contingent value would need to be configured.
Once the field type is set, the name of the domain appears in the domain drop-down list for any field of that type in the fields view and subtypes view.
When you create a domain, you must specify which type of domain you want to use.
There are two types of attribute domains:
Range Domains—A range domain specifies a valid range of values for a numeric or date attribute data type. When creating a range domain, you provide a minimum and maximum valid value. You can apply a range domain to short integer, long integer, big integer, float, double, date, date-only and time-only field types.
For example, in a feature class for water mains, you can have subtypes for transmission, distribution, and bypass water mains. Distribution water mains can have a pressure between 50 and 75 psi. For a distribution water main object to be valid, its pressure value must be a value between 50 and 75 psi.
The following example shows two range domains.
- Domain1_TimeOnly—A range domain created for a Time Only field type, where any time value between 7:00:00 AM - 9:00:00 PM would be valid.
- Domain2_DateOnly—A range domain created for a Date Only field type, where any date values between 4/20/2023 - 5/16/2023 would be valid.
Coded Value Domains—A coded value domain can apply to any attribute data type, be it text, numeric, date, and so forth. Coded value domains specify a valid set of values for an attribute.
For example, water mains may be buried under different types of surfaces, as signified by a GroundSurfaceType attribute field: pavement, gravel, sand, or none (for exposed water mains). The coded value domain includes both the actual value that is stored in the database (for example, 1 for pavement) and a more user-friendly description of what that value means. Coded value domains only allow users to select from a set list of values, so they cannot select any other values during configuration.
The following example shows a coded value domain.
- Domain3_TimeOnly—A coded value domain created for a Time Only field. Once this domain is applied to a Time Only field, only these hours appear in the list for a user to select and would be valid.
You can sort coded domain values and persist sorting after clicking the column header in coded values and clicking the Save sorted order check box. Clicking the Save sorted order check box overrides the current domain value sorting and is irreversible.
Split and merge policies
Often, when editing data, a single feature is split into two features or two separate features are combined, or merged, into a single feature. For example, in a landbase database, a land parcel may be split into two separate land parcels due to rezoning. Similar zoning changes may require two adjacent parcels to be merged into a single parcel.
While the results of these types of edit operations on the feature's geometry are predictable, their effects on the attribute values are not. The behavior of an attribute's values when a feature is split, if that attribute has a domain applied, is controlled by the domain's split policy. When two features are merged, any attribute with a domain applied will have its value controlled by the domain's merge policy.
If there is no domain assigned to a field, the attribute values are copied from the original feature to the new feature. If the original field has a value of NULL, the new feature will also have a value of NULL.
Each attribute domain has both a split policy and a merge policy. When a feature is split or merged, the geodatabase looks to these policies to determine what values the resulting feature or features have for a particular attribute.
An attribute for any given table, feature class, or subtype that has a domain applied can have one of three split policies, set on the domain's properties, that control the value of an attribute in the output objects:
- Default value—The attributes of the two resulting features take on the default value for the attribute of the given feature class or subtype.
- Duplicate—The attribute of the two resulting features takes on a copy of the original object's attribute value.
- Geometry ratio—The attributes of resulting features are a ratio of the original feature's value. The ratio is based on the ratio in which the original geometry is divided. If the geometry is divided equally, each new feature's attribute gets one-half of the value of the original object's attribute. Geometry ratio policies only apply to domains for numeric field types.
When two features are merged into a single feature, merge policies control the value of attributes in the new feature.
An attribute for any given table, feature class, or subtype that has a domain applied can have one of three merge policies, set on the domain's properties, that control the value of an attribute in the output objects:
- Default value—The attribute of the resulting feature takes on the default value for the attribute of the given feature class or subtype. This is the only merge policy that applies to nonnumeric fields and coded value domains.
- Sum values—The attribute of the resulting feature takes on the sum of the values from the original features' attributes.
- Geometry weighted—The attribute of the resulting feature is the weighted average of the values of the attributes from the original features. This average is based on the original feature's geometry.