サマリー
属性ドメインからテーブルを作成します。
使用法
- 属性ドメインからテーブルを作成すると、そのテーブルの追加の編集を行えます。たとえば、コード値ドメインからテーブルを作成して、コード値リストにコード値を追加できます。次に、[テーブル → ドメイン (Table To Domain)] ツールを使用して、元のドメインを更新できます。 
- ワークスペース ドメインは、ArcCatalog または [カタログ] ウィンドウでも管理できます。[データベース プロパティ] ダイアログ ボックスの [ドメイン] タブを使用して、ドメインを作成および変更できます。 
構文
DomainToTable_management (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 | 
コードのサンプル
Domain to Table (ドメイン → テーブル) の例 (Python ウィンドウ)
次の Python ウィンドウ スクリプトは DomainToTable (ドメイン → テーブル) 関数を使用する方法を示しています。
import arcpy
arcpy.env.workspace = "C:/data"
arcpy.DomainToTable_management("montgomery.gdb", "DistDiam", "diameters", "code", "descript")
Domain To Table (ドメイン → テーブル) の例 2 (スタンドアロン スクリプト)
このスタンドアロン スクリプトでは、ドメインを編集するワークフローの一部として 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.RemoveDomainFromField_management(inFeatures, inField)
 
    # Edit the domain values
    # Process: Remove a coded value from the domain
    arcpy.DeleteCodedValueFromDomain_management(dWorkspace, domName, codedValue)
 
    # Process: Create a table from the domain to edit it with ArcMap editing tools
    arcpy.DomainToTable_management(dWorkspace, domname, dWorkspace + os.sep + domname , codeField, fieldDesc)
 
    # Process: Delete the domain
    arcpy.DeleteDomain_management(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])
環境
ライセンス情報
- ArcGIS Desktop Basic: はい
- ArcGIS Desktop Standard: はい
- ArcGIS Desktop Advanced: はい