フィーチャの変更を検出(Detect Feature Changes) (データ管理)

ライセンス レベル:BasicStandardAdvanced

サマリ

アップデート ライン フィーチャがベース ライン フィーチャと空間的にマッチするところを見つけ、空間的な変更または属性の変更(あるいはその両方)および変更なしを検出して、それらの変更に関する情報を伴うマッチしたアップデート フィーチャ、マッチしないアップデート フィーチャ、およびマッチしないベース フィーチャが含まれる出力フィーチャクラスを作成します。

フィーチャを照合する仕組みの詳細

Detect Feature Changes

使用法

構文

DetectFeatureChanges_management (update_features, base_features, out_feature_class, search_distance, {match_fields}, {out_match_table}, {change_tolerance}, {compare_fields})
パラメータ説明データ タイプ
update_features

ベース フィーチャと比較するライン フィーチャ。

Feature Layer
base_features

変更を検出するためにアップデート フィーチャと比較するライン フィーチャ。

Feature Layer
out_feature_class

変更情報を含む出力ライン フィーチャクラス。出力には、関係するすべてのアップデート フィーチャ(マッチするものとしないもの)、およびマッチしないすべてのベース フィーチャが含まれます。

Feature Class
search_distance

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

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

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

Value Table
out_match_table
(オプション)

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

Table
change_tolerance
(オプション)

空間的な変更があるかどうかを判断するために使用される距離。マッチしたすべてのアップデート フィーチャが、この許容範囲に対してチェックされます。アップデート フィーチャのいずれかの部分がこのゾーンから外れている場合は、空間的な変更と見なされます。0 以上の距離を指定できます。デフォルトは 0 です。0 より大きい値を指定すると、出力に LEN_PCT フィールドと LEN_ABS フィールドが含まれます。優先的に適用される単位を選択することができます。デフォルトはフィーチャ単位です。

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

マッチしたアップデート フィーチャとベース フィーチャの間で属性の変更があるかどうかを判断するためのフィールド。

Value Table

コードのサンプル

DetectFeatureChanges(フィーチャの変更の検出)の例 1(Python ウィンドウ)

次の Python ウィンドウ スクリプトは、DetectFeatureChanges(フィーチャの変更の検出)をイミディエイト モードで使用する方法を示しています。

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.DetectFeatureChanges_edit("update_Roads.shp",
                                "base_Roads.shp", "output_changes.shp"
                                "25 Feet", #, #, "7.6 Meterd",
                                ["rdClass", "roadClass"])
DetectFeatureChanges(フィーチャの変更の検出)の例 2(スタンドアロン Python スクリプト)

次のスタンドアロン スクリプトは、DetectFeatureChanges(フィーチャの変更の検出)関数をスクリプティング環境で適用する方法の例を示しています。

# Name:        DetectFeatureChanges_example_script2.py
# Description: Perform change detection between newly received road data and
#              existing road data and find the number of new roads and the
#              total length of them.
# 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
updateFeatures = "updateRoads"
baseFeatures = "baseRoads"
dfcOutput = "dfc_out"

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

statsTable = "new_roads_stats"

# Perform spatial change detection
arcpy.DetectFeatureChanges_management(updateFeatures, baseFeatures, dfcOutput, search_distance, match_fields)

# ====================================================================================
# Note 1:  The result of DetectFeatureChanges may contain errors; see tool reference.
#          Inspection and editing may be necessary to ensure correct CHANGE_TYPE N, which
#          represents un-matched update feautres, before further calculations.
#
#          One of the quick ways of checking whether the CHANGE_TYPE N features have
#          matching base features is to find their mid-points and use them to search for
#          features in base data, as processed below.
# ====================================================================================

# ======== Check update roads with CHANGE_TYPE N for potential match
# Make Feature Layer with selection of CHANGE_TYPE = 'N' (un-matched update features)
arcpy.MakeFeatureLayer_management(dfcOutput, "sel_N_layer", "CHANGE_TYPE = 'N'")

# Get mid-points of the selected features; the mid-points carry all the attributes.
arcpy.FeatureVerticesToPoints_management("sel_N_layer", "in_memory\midPts", "MID")

# Find nearest base features from the mid-points
arcpy.Near_analysis("in_memory\midPts", baseFeatures, "300 Feet")

# ====================================================================================
# Note 2:  At this point you can manually inspect the midPts by the NEAR_DIST values; 
#          the lower the values, the higher chance (not always) a match was missed in the 
#          dfc process. Delete features from midPts that have found matching base features 
#          before further process.
# ====================================================================================

# Transfer CHANGE_TYPE values from features of midPts to update features
arcpy.JoinField_management(updateFeatures, "OBJECTID", "in_memory\midPts", "UPDATE_FID", "CHANGE_TYPE")

# Get the count of new roads and the total length; the remaining roads have
# Null values for CHANGE_TYPE.
arcpy.Frequency_analysis(updateFeatures, statsTable, "CHANGE_TYPE", "Shape_Length")

環境

関連トピック

ライセンス情報

ArcGIS for Desktop Basic: ×
ArcGIS for Desktop Standard: ×
ArcGIS for Desktop Advanced: ○
7/28/2014