Tools that honor the Transfer field domain descriptions environment control whether the output will include fields containing domain and subtype descriptions, as well as fields containing domain and subtype codes. This setting is relevant when the input to a geoprocessing tool is a geodatabase feature class or table with defined domains and subtypes.
By default, only domain and subtype codes are included in shapefile or dBASE output. This geoprocessing environment is useful because shapefiles and dBASE tables (.dbf file) do not support advanced features such as attribute field domains and subtypes; however, some workflows require the output to be one of these formats, and the domain and subtype description information is necessary to maintain.
Learn more about other limitations when using shapefile output
- If this geoprocessing environment is used, the output will include additional fields. If the input has a subtype field, the output will have one field for the subtype code (named after the original field) and one field for the subtype description (named after the original field and prefixed by d_, for description). If the input has attribute domains, the output will have one field for each of the fields with a domain (named after the original field) containing domain codes, and one field for each of the fields with a domain (named after the original field and prefixed by d_, for description) containing domain descriptions.
- When viewing the attribute table or identifying a feature of a geodatabase feature class or table with subtypes and domains defined, the attributes that are presented are the domain and subtype descriptions (not codes).
- Transferring field domain descriptions to the output of the geoprocessing operation will take more time (slower performance) than transferring only the domain and subtype codes. Only use this environment setting if domain and subtype descriptions are specifically needed in the output.
- Unchecked—The output will not include additional fields containing subtype and domain descriptions. This is the default.
- Checked—The output will include additional fields containing subtype and domain descriptions.
arcpy.env.transferDomains = transfer_domains
NOT_TRANSFER_DOMAINS or False
The output will not include additional fields containing subtype and domain descriptions. This is the default.
TRANSFER_DOMAINS or True
The output will include additional fields containing subtype and domain descriptions.
# Name: exportToShapefile.py # Purpose: Export a geodatabase feature class to a shapefile, include domain and subtype descriptions # Import system modules import arcpy # Set environment settings arcpy.env.workspace = "C:/data" arcpy.env.transferDomains = True # The equivalent with a keyword is # arcpy.env.transferDomains = "TRANSFER_DOMAINS" # Set local variables inFeatures = "Habitat_Analysis.gdb/vegtype" outLocation = "Shapefiles" outName = "Vegetation.shp" arcpy.conversion.FeatureClassToFeatureClass(inFeatures, outLocation, outName)