Alter Domain (Data Management)

Summary

Alters the properties of an existing attribute domain in a workspace.

Usage

  • Domain management involves the following steps:

    1. Modify an existing domain using this tool, or create a new 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.
  • Coded value domains only support the default value, duplicate split policy, and default value merge policy.

  • 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.

  • The properties of a domain in an enterprise geodatabase workspace can be altered when the Input Workspace value is a database connection file connected as the domain owner or the geodatabase administrator.

Parameters

LabelExplanationData Type
Input Workspace

The geodatabase that contains the domain that will be altered.

Workspace
Domain Name

The name of the domain the will be altered.

String
New Domain Name
(Optional)

The new name of the domain.

String
New Domain Description
(Optional)

The new description of the domain.

String
New Split Policy
(Optional)

Specifies the split policy that will used for the domain. The behavior of an attribute's values when a feature is split is controlled by its split policy.

  • Use the attribute's default valueThe attributes of the two resulting features will be the default value of the attribute of the given feature class or subtype.
  • Duplicate attribute valuesThe attribute of the two resulting features will be a copy of the original object's attribute value.
  • Use geometric ratioThe attributes of resulting features will be a ratio of the original feature's value. The ratio is based on the proportion into which the original geometry is divided. If the geometry is divided equally, the attribute of each new feature will be one-half the value of the original object's attribute. This option only applies to range domains.
String
New Merge Policy
(Optional)

Specifies the merge policy that will be used for the domain. When two features are merged into a single feature, merge policies will control attribute values in the new feature. This parameter is only applicable to range domains, as coded value domains can only use the default merge policy.

  • Use the attribute's default valueThe attribute of the resulting feature will be the default value of the attribute of the given feature class or subtype. This option only applies to nonnumeric fields and coded value domains.
  • Sum of the valuesThe attribute of the resulting feature will be on the sum of the values from the original feature's attribute. This option only applies to range domains.
  • Area weighted averageThe attribute of the resulting feature will be the weighted average of the attribute values of the original features. The average is based on the original feature's geometry. This option only applies to range domains.
String
New Domain Owner
(Optional)

The name of the database user that the domain ownership will be transferred to. Ensure that the new domain owner exists in the database; the tool does not check the validity of the owner name specified. This parameter is not applicable for domains created in a file geodatabase.

String

Derived Output

LabelExplanationData Type
Updated Input Workspace

The updated input workspace.

Workspace

arcpy.management.AlterDomain(in_workspace, domain_name, {new_domain_name}, {new_domain_description}, {split_policy}, {merge_policy}, {new_domain_owner})
NameExplanationData Type
in_workspace

The geodatabase that contains the domain that will be altered.

Workspace
domain_name

The name of the domain the will be altered.

String
new_domain_name
(Optional)

The new name of the domain.

String
new_domain_description
(Optional)

The new description of the domain.

String
split_policy
(Optional)

Specifies the split policy that will used for the domain. The behavior of an attribute's values when a feature is split is controlled by its split policy.

  • DEFAULTThe attributes of the two resulting features will be the default value of the attribute of the given feature class or subtype.
  • DUPLICATEThe attribute of the two resulting features will be a copy of the original object's attribute value.
  • GEOMETRY_RATIOThe attributes of resulting features will be a ratio of the original feature's value. The ratio is based on the proportion into which the original geometry is divided. If the geometry is divided equally, the attribute of each new feature will be one-half the value of the original object's attribute. This option only applies to range domains.
String
merge_policy
(Optional)

Specifies the merge policy that will be used for the domain. When two features are merged into a single feature, merge policies will control attribute values in the new feature. This parameter is only applicable to range domains, as coded value domains can only use the default merge policy.

  • DEFAULTThe attribute of the resulting feature will be the default value of the attribute of the given feature class or subtype. This option only applies to nonnumeric fields and coded value domains.
  • SUM_VALUESThe attribute of the resulting feature will be on the sum of the values from the original feature's attribute. This option only applies to range domains.
  • AREA_WEIGHTEDThe attribute of the resulting feature will be the weighted average of the attribute values of the original features. The average is based on the original feature's geometry. This option only applies to range domains.
String
new_domain_owner
(Optional)

The name of the database user that the domain ownership will be transferred to. Ensure that the new domain owner exists in the database; the tool does not check the validity of the owner name specified. This parameter is not applicable for domains created in a file geodatabase.

String

Derived Output

NameExplanationData Type
out_workspace

The updated input workspace.

Workspace

Code sample

AlterDomain example 1 (Python window)

The following code snippet demonstrates how to use AlterDomain function in the Python window.

arcpy.env.workspace = "C:/data"
arcpy.AlterDomain_management("montgomery.gdb", "Material", "PipeMaterial", "Valid pipe materials", "DUPLICATE", "DEFAULT")
AlterDomain example 2 (stand-alone script)

The following code snippet demonstrates how to use AlterDomain function in a stand-alone script.

# Name: AlterDomain.py
# Description: Modify an attribute domain to constrain valid date
#              range for wildlife sightings.
# Author: ESRI
 
# Import system modules
import arcpy
from arcpy import env
 
# Set the workspace
env.workspace = "C:/data"
 
# Set local parameters
gdb = "Habitat.gdb"
domName = "CoastalArea"
new_domName = "SightingSeason"
new_desc = "Range of valid dates for sightings"
new_split = "DUPLICATE"
new_merge = "AREA_WEIGHTED"

# Process: Modify the range domain
arcpy.AlterDomain_management(gdb, domName, new_domName, new_desc, new_split, new_merge)

Environments

Related topics