ArcGIS for Desktop

  • ドキュメント
  • 価格
  • サポート

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS for Desktop

完全なプロ仕様の GIS

ArcGIS for Server

エンタープライズ GIS

ArcGIS for Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • 価格
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

ヘルプ

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • その他...

リレーションシップ クラスの移行 (Migrate Relationship Class)

  • サマリ
  • 使用法
  • 構文
  • コードのサンプル
  • 環境
  • ライセンス情報

サマリ

ObjectID ベースのリレーションシップ クラスを GlobalID ベースのリレーションシップ クラスに移行します。

使用法

  • このツールは、ObjectID ベースの既存のリレーションシップ クラスを、ArcGIS Runtime のジオデータベース要件に準拠するように変更します。

  • このツールを使用するには、[入力リレーションシップ クラス] に含まれる移行元のフィーチャクラスまたはテーブルに、GlobalID フィールドが存在する必要があります。移行先クラスには GlobalID フィールドが含まれている必要もあります。

  • 既存の入力リレーションシップ クラスは、ObjectID ベースである必要があります。データの履歴管理は有効でなくてもかまいません。

  • このツールでは、入力として、バージョン対応登録データとバージョン非対応データがサポートされています。

  • このツールでは、入力として、フィーチャリンク アノテーション リレーションシップ クラスはサポートされていません。これらのリレーションシップは、ObjectID ベースのままである必要があるためです。

  • このツールの入力として使用されるデータのバックアップ コピーを取っておくことをお勧めします。

構文

MigrateRelationshipClass_management (in_relationship_class)
パラメータ説明データ タイプ
in_relationship_class

GlobalID ベースのリレーションシップ クラスに移行される ObjectID ベースのリレーションシップ クラス。移行元および移行先のフィーチャクラスまたはテーブルには、すでに GlobalID が存在する必要があります。

Relationship Class

コードのサンプル

MigrateRelationshipClass (リレーションシップ クラスの移行) の例 1 (Python ウィンドウ)

次の Python ウィンドウ スクリプトは、イミディエイト モードで MigrateRelationshipClass (リレーションシップ クラスの移行) ツールを使用する方法を示しています。

arcpy.MigrateRelationshipClass_management(r'C:\Data\Relationships.gdb\OneToMany')
MigrateRelationshipClass (リレーションシップ クラスの移行) の例 2 (スタンドアロン スクリプト)

次のスクリプトは、スタンドアロン スクリプトで MigrateRelationshipClass (リレーションシップ クラスの移行) ツールを使用する方法を示しています。

# Name: MigrateRelationshipClass_Example.py
# Description: Migrate an ObjectID-based relationship class to a GlobalID-based
#       relationship class. This script lists the ObjectID-based relationships classes
#       in a workspace, checks for GlobalIDs in the origin, then runs the tool

# Import system modules
import arcpy

# Set local variables
workspace = r'C:\Data\Relationships.gdb'

# List all of the relationship classes within the given workspace
rc_list = [c.name for c in arcpy.Describe(workspace).children if c.datatype == "RelationshipClass"]

# Build a list of relationship classes which have an OBJECTID based origin class key
rc_migrate = []
for rc in rc_list:
    rc_path = workspace + "\\" + rc
    rc_desc = arcpy.Describe(rc_path)
    for item in rc_desc.OriginClassKeys:
        if "OBJECTID" in item:
            rc_migrate.append(rc_path)

# Check that the origin feature classes have Global Ids
rc_final = []
for rel in rc_migrate:
    originfc = workspace + "\\" + arcpy.Describe(rel).originClassNames[0]
    if arcpy.ListFields(originfc,"","GlobalID"):
        rc_final.append(rel)
        print("Adding {0}  to the list to migrate. \n".format(rel.rsplit("\\",1)[1]))
    else:
        print("{0} must have Global Ids to migrate relationship class.\n".format(originfc.rsplit("\\",1)[1]))

# Pass the list of valid relationship classes into the Migrate Relationship tool
print("Passing valid relationship classes into the Migrate Relationship Class tool.\n")
for rel_class in rc_final:
    print("Migrating {0}... \n".format(rel_class.rsplit("\\",1)[1]))
    arcpy.MigrateRelationshipClass_management(rel_class)
    print(arcpy.GetMessages() + "\n")

環境

  • 現在のワークスペース

ライセンス情報

  • ArcGIS for Desktop Basic: ×
  • ArcGIS for Desktop Standard: ○
  • ArcGIS for Desktop Advanced: ○

関連トピック

  • [リレーションシップ クラス] ツールセットの概要
  • RelationshipClass properties
このトピックへのフィードバック

ArcGIS for Desktop

  • ホーム
  • ドキュメント
  • 価格
  • サポート

ArcGIS プラットフォーム

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

Esri について

  • 会社概要
  • 採用情報
  • スタッフ ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | プライバシー | リーガル