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
  • マイ プロフィール
  • サイン アウト

ヘルプ

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

属性の割り当て (Transfer Attributes)

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

サマリ

ソース ライン フィーチャが空間的にターゲット ライン フィーチャと一致している場所を検索し、指定された属性をソース フィーチャから一致するターゲット フィーチャに割り当てます。

[属性の割り当て (Transfer Attributes)] は、通常は、あるデータセット内のフィーチャの属性を別のデータセット内の対応するフィーチャにコピーするために使用されます。たとえば、道路フィーチャの名前を、以前にデジタイズして保持しているデータセットから、新たに収集した精度の高い新しいデータセット内のフィーチャに割り当てる場合に使用されます。これら 2 つのデータセットは、通常、ソース フィーチャおよびターゲット フィーチャと呼ばれます。このツールは、指定された検索距離の範囲内で対応するソース ライン フィーチャとターゲット ライン フィーチャを検索し、指定された属性をソース ラインからターゲット ラインに割り当てます。

図

属性の割り当て (Transfer Attributes)

使用法

    注意:

    このツールを使用すると入力データが変更されます。詳しい説明および不適切なデータ変更を防ぐための方法については、「出力を伴わないツール」をご参照ください。

    注意:

    すべての入力は、同じ座標系に存在する必要があります。

  • 入力データのすべての領域の範囲は、処理範囲として使用されます。使用されるソース フィーチャとターゲット フィーチャの数は、処理メッセージにレポートされます。

  • [割り当てフィールド] パラメーターで、1 つ以上のフィールドを指定する必要があります。割り当てフィールドの名前がターゲット フィーチャ テーブルのフィールドと同じである場合、割り当てフィールドの名前が他と重複することのないように、名前の末尾に _1 (あるいは _2、_3、... など) が付加されます。

    複数のソース フィーチャが 1 つ以上のターゲット フィーチャと一致した場合、ソース フィーチャのうちの 1 つのフィールド値のみがターゲット フィーチャに割り当てられます。ソース フィールドに値がない場合、属性の割り当ては行われません。

  • [検索距離] パラメーターは、一致候補の検索で使用されます。対応するフィーチャ間のずれの大部分を捉えることができるほど十分な大きさの距離を使用しますが、候補が多くなって不必要な処理が発生し、不正な一致が得られる場合があるため、この値を大きくし過ぎないでください。

  • [出力照合テーブル] の指定は任意です。この照合テーブルには、ソース FID とターゲット FID、一致グループ、一致関係、空間と属性の一致条件から得られた一致の信頼度など、フィーチャの完全な一致情報が含まれています。この情報によって、一致状況を理解し、照合後の検査、編集、および解析を容易に行うことができます。詳細は、「フィーチャの照合と照合テーブルについて」をご参照ください。

  • フィーチャの照合の精度は、データの品質、複雑さ、および 2 つの入力の類似性に依存します。

    前処理でデータ エラーを最小化し、関連するフィーチャを入力として選択する必要があります。一般に、入力データセット内のフィーチャがトポロジ的に正しく、有効なジオメトリを有しており、シングルパートであって重複していないことは、常に役立ちます。そうでない場合、予期しない結果が発生するおそれがあります。

構文

TransferAttributes_edit (source_features, target_features, transfer_fields, search_distance, {match_fields}, {out_match_table})
パラメータ説明データ タイプ
source_features

属性の割り当て元のライン フィーチャ。

Feature Layer
target_features

属性の割り当て先のライン フィーチャ。指定した割り当てフィールドが、ターゲット フィーチャに追加されます。

Feature Layer
transfer_fields
[field,...]

ターゲット フィーチャに割り当てられるソース フィールドのリスト。1 つ以上のフィールドを指定する必要があります。

Field
search_distance

一致候補の検索に使用される距離。ゼロより大きい距離を指定する必要があります。優先的に適用される単位を選択することができます。デフォルトはフィーチャ単位です。

Linear unit
match_fields
[[source_field, target_field],...]
(オプション)

ソース フィーチャおよびターゲット フィーチャのフィールドのリスト。これを指定すると、照合候補に対して各フィールド ペアがチェックされるため、正しい適合を特定するために役立ちます。

Value Table
out_match_table
(オプション)

完全なフィーチャ照合情報を含む出力テーブル。

Table

コードのサンプル

TransferAttributes (属性の割り当て) の例 1 (Python ウィンドウ)

次の Python ウィンドウ スクリプトで、TransferAttributes (属性の割り当て) 関数をイミディエイト モードで使用する方法を示します。

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.TransferAttributes_edit("source_Roads.shp",
                              "target_Roads.shp", "RoadName, PaveType"
                              "25 Feet")
TransferAttributes (属性の割り当て) の例 2 (スタンドアロン Python スクリプト)

次のスタンドアロン Python スクリプトは、TransferAttributes (属性の割り当て) 関数をスクリプティング環境に適用する例を示しています。

# Name:        TransferAttributes_example_script2.py
# Description: Performs attribute transfer from newly updated roads (source) to existing
#              base roads (target). Where the source and target features are matched in
#              many-to-one or many-to-many (m:n) relationships, attributes are transferred 
#              from only one of the m source features to the n target features. This script
#              includes a post-process that flags resulting target features with the m:n
#              match relationships. You can inspect the flagged features and retrieve the
#              attributes from the desired source features if necessary.
# Author:      Esri
# -----------------------------------------------------------------------

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.overwriteOutput = True
env.workspace = r"D:\conflationTools\ScriptExamples\data.gdb"

# Set local variables
sourceFeatures = "updateRoads"
targetFeatures = "baseRoads"
transfer_fields = "RD_NAME; RD_ID"

search_distance = "300 Feet"
match_fields = "RD_NAME FULLNAME"

outMatchTable = "ta_mtbl"

# Make a copy of the targetFeatures for attribute transfer
targetCopy = targetFeatures + "_Copy"
arcpy.CopyFeatures_management(targetFeatures, targetCopy)

# Performs attribute transfer
arcpy.TransferAttributes_edit(sourceFeatures, targetCopy, transfer_fields, search_distance, match_fields, outMatchTable)

# ====================================================================================
# Note 1:  The result of TransferAttributes may contain errors; see tool reference.
#          Additional analysis steps may be necessary to check the results; these steps
#          are not included in this script.
#
#          The following process identifies m:n matches between source and target features 
#          and flag features in targetCopy for inspection.
# ====================================================================================

# Add a field srcM_inMN to the match table to store the m count of source features in m:n relationship
field_srcM_inMN = "srcM_inMN"
arcpy.AddField_management(outMatchTable, field_srcM_inMN)

codeblock = """
def getM(fld):
    x = fld.split(\":\")[0]
    if x.isnumeric():
        if int(x) > 0:
            return int(x)
    return -1
"""

# Calculate values for srcM_inMN
arcpy.CalculateField_management(outMatchTable, field_srcM_inMN, "getM(!FM_MN!)", "PYTHON_9.3", codeblock)

# Make a table view of the match table, selecting srcM_inMN values greater than 1 
# (excluding 1:n relationships which don't need to be inspected)
arcpy.MakeTableView_management(outMatchTable, "mtable_view", field_srcM_inMN + "> 1")

# For the selected records, transfer srcM_inMN and SRC_FID fields and values to the targetCopy
arcpy.JoinField_management(targetCopy, "OBJECTID", "mtable_view", "TGT_FID", field_srcM_inMN + "; SRC_FID")

# ====================================================================================
# Note 2:  Now the fields srcM_inMN and SRC_FID are in the copy of the target features.
#          The srcM_inMN values are the counts of matched source features; the SRC_FID
#          values indicate the source feature IDs from which the transferred attributes
#          come from.
#
#          At this point you can interactively review the transferred attributes for the
#          flagged features. If you want to replace any of them by those from a different
#          source feature, you would need to make the edits as needed.
# ====================================================================================

環境

  • 現在のワークスペース
  • 範囲

ライセンス情報

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

関連トピック

  • 補正ツールセットの概要
  • フィーチャの照合と一致テーブル
このトピックへのフィードバック

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. | プライバシー | リーガル