ListDomains
サマリー
The ListDomains function lists the attribute domains belonging to a geodatabase.
構文
ListDomains(workspace)
| パラメーター | 説明 | データ タイプ |
|---|---|---|
|
workspace |
The geodatabase from which domain information will be returned. |
String |
戻り値
| データ タイプ | 説明 |
|---|---|
|
Domain |
A list containing domain objects. Each domain object contains properties to get domain information. |
コードのサンプル
ListDomains example
List and describe all the workspace domains.
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]}")