ラベル | 説明 | データ タイプ |
入力ワークスペース | テーブルに変換される属性ドメインを含むワークスペース。 | Workspace |
ドメイン名 | 既存の属性ドメインの名前。 | String |
出力テーブル | 作成されるテーブル。 | Table |
コード値フィールド | コード値を格納する、作成されたテーブル内のフィールドの名前。 | String |
説明フィールド | コード値説明を格納する、作成されたテーブル内のフィールドの名前。 | String |
コンフィグレーション キーワード (オプション) | ジオデータベース テーブルの場合、テーブルを作成するためのカスタム格納キーワード。 | String |
サマリー
属性ドメインからテーブルを作成します。
使用法
属性ドメインからテーブルを作成すると、テーブルをさらに編集できます。 たとえば、コード値ドメインからのテーブルの作成、コード値リストへのその他のコード値の追加、[テーブル → ドメイン (Table To Domain)] ツールを使った元のドメインの更新が可能になります。
また、[ドメイン] ビューでもドメインを管理できます。このビューは、[データ] リボンの [デザイン] グループにある [ドメイン] ボタンをクリックして、開くことができます。
パラメーター
arcpy.management.DomainToTable(in_workspace, domain_name, out_table, code_field, description_field, {configuration_keyword})
名前 | 説明 | データ タイプ |
in_workspace | テーブルに変換される属性ドメインを含むワークスペース。 | Workspace |
domain_name | 既存の属性ドメインの名前。 | String |
out_table | 作成されるテーブル。 | Table |
code_field | コード値を格納する、作成されたテーブル内のフィールドの名前。 | String |
description_field | コード値説明を格納する、作成されたテーブル内のフィールドの名前。 | String |
configuration_keyword (オプション) | ジオデータベース テーブルの場合、テーブルを作成するためのカスタム格納キーワード。 | String |
コードのサンプル
次の Python ウィンドウ スクリプトは、DomainToTable 関数の使用方法を示しています。
import arcpy
arcpy.env.workspace = "C:/data"
arcpy.management.DomainToTable("montgomery.gdb", "DistDiam", "diameters", "code", "descript")
このスタンドアロン スクリプトでは、ドメインを編集するワークフローの一部として DomainToTable 関数を使用します。
# Name: RemoveDomainsExample.py
# Purpose: Update an attribute domain to constrain valid pipe material values
# Import system modules
import arcpy
import os
try:
# Set the workspace (to avoid having to type in the full path to the data every time)
arcpy.env.workspace = "C:/data"
# set local parameters
inFeatures = "Montgomery.gdb/Water/DistribMains"
inField = "MATERIAL"
dWorkspace = "Montgomery.gdb"
domName = "Material"
codedValue = "ACP: Asbestos concrete"
codeField = "TYPE"
fieldDesc= "DESRIPT"
# Process: Remove the constraint from the material field
arcpy.management.RemoveDomainFromField(inFeatures, inField)
# Edit the domain values
# Process: Remove a coded value from the domain
arcpy.management.DeleteCodedValueFromDomain(dWorkspace, domName, codedValue)
# Process: Create a table from the domain
arcpy.management.DomainToTable(dWorkspace, domname, dWorkspace + os.sep + domname , codeField, fieldDesc)
# Process: Delete the domain
arcpy.management.DeleteDomain(dWorkspace, domName)
# Edit the domain table outside of geoprocessing
# and then bring the domain back in with the TableToDomain process
except Exception as err:
print(err.args[0])
ライセンス情報
- Basic: Yes
- Standard: Yes
- Advanced: Yes