摘要
列出属于地理数据库的属性域。
语法
ListDomains (workspace)
| 参数 | 说明 | 数据类型 | 
workspace  | The geodatabase from which domain information will be returned.  | String | 
代码示例
列出并描述所有工作空间域。
import arcpy
domains = arcpy.da.ListDomains("C:/Boston/Boston.gdb")
for domain in domains:
    print(f"Domain name: {domain.name}")
    if domain.domainType == "CodedValue":
        coded_values = domain.codedValues
        for val, desc in coded_values.items():
            print(f"{val} : {desc}")
    elif domain.domainType == "Range":
        print(f"Min: {domain.range[0]}")
        print(f"Max: {domain.range[1]}")