Create Domain (Data Management) |
|
Release 9.2
Last modified November 29, 2010 |
![]() ![]() ![]() Print all topics in : "Tools" |
Creates an attribute domain in the specified workspace.
Usage tips
Coded value domains support only default value and duplicate split policies and default value merge policies.
Range domains support all split and merge policies. After a Split or Merge operation, the attribute values of output features are calculated based on the numeric values of the input features and the specified split or merge policy.
Domain management involves the following steps:
1) Create the domain using the Create Domain tool.
2) Add values to or set the range of values for the domain using the Add Coded Value to Domain tool or Set Value For Range Domain tool.
3) Associate the domain with a feature class using the Assign Domain To Field tool.
Workspace domains can also be managed in ArcCatalog. Domains can be created and modified through the Domains tab on the Database Properties dialog box.
The environment settings do not have an effect on this tool.
Command line syntax
An overview of the Command Line window
CreateDomain_management <in_workspace> <domain_name> <domain_description> <SHORT | LONG | FLOAT | DOUBLE | TEXT | DATE> {CODED | RANGE} {DEFAULT | DUPLICATE | GEOMETRY_RATIO} {DEFAULT | SUM_VALUES | AREA_WEIGHTED}
Parameter | Explanation | Data Type |
<in_workspace> |
The geodatabase that will contain the new domain. |
Workspace |
<domain_name> |
The name of the domain that will be created. |
String |
<domain_description> |
The description of the domain that will be created. |
String |
<SHORT | LONG | FLOAT | DOUBLE | TEXT | DATE> |
The type of attribute domain to create. Attribute domains are rules that describe the legal values of a field type. Specify a field type that matches the data type of the field to which the attribute domain will be assigned.
|
String |
{CODED | RANGE} |
The domain type to create:
|
String |
{DEFAULT | DUPLICATE | GEOMETRY_RATIO} |
The split policy of the created domain. The behavior of an attribute's values when a feature that is split is controlled by its split policy.
|
String |
{DEFAULT | SUM_VALUES | AREA_WEIGHTED} |
The merge policy of the created domain. When two features are merged into a single feature, merge policies control attribute values in the new feature.
|
String |
workspace E:\arcgis\ArcTutor\BuildingaGeodatabase CreateDomain montgomery.mdb DistDiam "Valid diameter for distribution mains" FLOAT CODED
Scripting syntax
About getting started with writing geoprocessing scripts
CreateDomain_management (in_workspace, domain_name, domain_description, field_type, domain_type, split_policy, merge_policy)
Parameter | Explanation | Data Type |
in_workspace (Required) |
The geodatabase that will contain the new domain. |
Workspace |
domain_name (Required) |
The name of the domain that will be created. |
String |
domain_description (Required) |
The description of the domain that will be created. |
String |
field_type (Required) |
The type of attribute domain to create. Attribute domains are rules that describe the legal values of a field type. Specify a field type that matches the data type of the field to which the attribute domain will be assigned.
|
String |
domain_type (Optional) |
The domain type to create:
|
String |
split_policy (Optional) |
The split policy of the created domain. The behavior of an attribute's values when a feature that is split is controlled by its split policy.
|
String |
merge_policy (Optional) |
The merge policy of the created domain. When two features are merged into a single feature, merge policies control attribute values in the new feature.
|
String |
# Purpose: Create an attribute domain to constrain|material values # Create the Geoprocessor object import arcgisscripting gp = arcgisscripting.create() try: # Set the workspace (to avoid having to type in the full path to the data every time) gp.Workspace = "E:/arcgis/ArcTutor/BuildingaGeodatabase" # Set variable for domain name domname = "Material4" # Process: Create the coded value domain gp.CreateDomain("montgomery.mdb", domname, "Valid|materials", "TEXT", "CODED") # Process: Add valid material types to the domain gp.AddCodedValueToDomain("montgomery.mdb", domname, "CI", "Cast iron") gp.AddCodedValueToDomain("montgomery.mdb", domname, "DI", "Ductile iron") gp.AddCodedValueToDomain("montgomery.mdb", domname, "PVC", "PVC") gp.AddCodedValueToDomain("montgomery.mdb", domname, "ACP", "Asbestos concrete") gp.AddCodedValueToDomain("montgomery.mdb", domname, "COP", "Copper") # Process: Constrain the material value of distribution mains gp.AssignDomainToField("Montgomery.mdb/Water/Distribmains", "Material", domname) except: # If an error occurred while running a tool print the messages print gp.GetMessages()