ListDomains

この ArcGIS 3.1 ドキュメントはアーカイブされており、今後更新されません。 コンテンツとリンクが古い場合があります。 最新のドキュメントをご参照ください

サマリー

ジオデータベースに属する属性ドメインをリストします。

構文

ListDomains (workspace)
パラメーター説明データ タイプ
workspace

The geodatabase from which domain information will be returned.

String
戻り値
データ タイプ説明
Domain

Domain オブジェクトを含むリスト。 各 Domain オブジェクトには、ドメイン情報を取得するプロパティが含まれています。

コードのサンプル

ListDomains の例

すべてのワークスペース ドメインをリストおよび説明します。

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]}")

関連トピック


このトピックの内容