arcpy.management.RasterCompare(in_base_raster, in_test_raster, {compare_type}, {ignore_option}, {continue_compare}, {out_compare_file}, {parameter_tolerances}, {attribute_tolerances}, {omit_field}, {out_compare_raster})
|
名前
|
説明
|
データ タイプ
|
|
in_base_raster
|
in_test_raster パラメーター値と比較されるラスターまたはモザイク データセット。 このパラメーター値は、有効と宣言したデータです。 このベース データには、正しいコンテンツおよび情報が含まれます。
|
Raster Layer; Mosaic Layer
|
|
in_test_raster
|
in_base_raster パラメーター値と比較されるラスターまたはモザイク データセット。 このパラメーター値は、新しい情報の編集またはコンパイルによって変更を行ったデータです。
|
Raster Layer; Mosaic Layer
|
|
compare_type
(オプション)
|
比較するラスターの種類を指定します。
RASTER_DATASET—2 つのラスター データセットを比較します。
GDB_RASTER_DATASET—ジオデータベース内の 2 つのラスター データセットを比較します。
MOSAIC_DATASET—2 つのモザイク データセットを比較します。
|
String
|
|
ignore_option
[ignore_option,...]
(オプション)
|
比較で無視されるプロパティを指定します。
BandCount—バンド数は無視されます。
Extent—範囲は無視されます。
Columns And Rows—カラム数およびロウ数は無視されます。
Pixel Type—ピクセル タイプは無視されます。
NoData—NoData 値は無視されます。
Spatial Reference—空間参照系は無視されます。
Pixel Value—ピクセル値は無視されます。
Colormap—既存のカラーマップは無視されます。
Raster Attribute Table—既存の属性テーブルは無視されます。
Statistics—統計情報は無視されます。
Metadata—メタデータは無視されます。
Pyramids Exist—既存のピラミッドは無視されます。
Compression Type—圧縮タイプは無視されます。
Data Source Type—データ ソース タイプは無視されます。
|
String
|
|
continue_compare
(オプション)
|
入力間の最初の相違点を検出した後も比較を継続するかどうかを指定します。
|
Boolean
|
|
out_compare_file
(オプション)
|
入力間のすべての類似点と相違点が含まれている出力ファイル。 このファイルは、ArcGIS でテーブルとして表示および使用できる、カンマ区切りテキスト ファイルです。
|
File
|
|
parameter_tolerances
[[Parameter, Tolerance, Type],...]
(オプション)
|
フィーチャが同一と見なされる範囲を決定する許容値。 すべてのパラメーターに同じ許容値を適用するか、パラメーターごとに異なる許容値を適用することができます。
許容値のタイプは、値としても端数としても使用できます。
許容値のタイプが端数の場合は、ピクセルごとに別々の値が設定されているため、ピクセルごとに許容値が異なります。 たとえば、許容値の端数が 0.5 に設定されている場合、許容値は次のように算出されます。
値テーブル列:
Parameter—There are seven types of parameter tolerances you can adjust.
All—The extents, pixel values, minimums, maximums, means, and standard deviations will be compared to determine if they are equal within the specified tolerance.
Extent—If the difference of the extents is within the tolerance, they will be considered equal.
Pixel_Value—If the difference of the pixel values is within the tolerance, they will be considered equal.
Statistics_Minimum—If the difference of the minimum values is within the tolerance, they will be considered equal.
Statistics_Maximum—If the difference of the maximum values is within the tolerance, they will be considered equal.
Statistics_Mean—If the difference of the mean values is within the tolerance, they will be considered equal.
Statistics_Standard_Deviation—If the difference of the standard deviations is within the tolerance, they will be considered equal.
Tolerance—Set the tolerance type to a specified value or use that value as a fraction.
Type—Set the type of tolerance value for the selected parameter.
|
Value Table
|
|
attribute_tolerances
[[Field, {Tolerance}],...]
(オプション)
|
属性値が等しいと考えられる範囲を決める数値。 このパラメーターは数値フィールド タイプにのみ適用されます。
値テーブル列:
Field—The numeric field that the tolerance will be applied to.
Tolerance—The numeric value that determines the range in which attribute values are considered equal. This only applies to numeric field types.
|
Value Table
|
|
omit_field
[omit_field,...]
(オプション)
|
比較時に除外されるフィールド。 これらのフィールドのフィールド定義とテーブル値は無視されます。
|
String
|
|
out_compare_raster
(オプション)
|
in_base_raster および in_test_raster パラメーター値の差異から構成される出力ラスター。
|
Raster Dataset
|
派生した出力
|
名前
|
説明
|
データ タイプ
|
|
compare_status
|
相違点が検出されない場合は比較状況が'true' 、相違点が検出された場合は 'false' になります。
|
Boolean
|
コードのサンプル
RasterCompare の例 1 (Python ウィンドウ)
以下は、RasterCompare 関数を実行する Python サンプルです。
import arcpy
arcpy.management.RasterCompare("C:/workspace/image1.tif","C:/workspace/image2.tif",
"RASTER_DATASET","'Pyramids Exist'",
"CONTINUE_COMPARE","C:/workspace/compare01.txt",
"Pixel_Value 1 Value","Count 5","OID")
RasterCompare の例 2 (スタンドアロン スクリプト)
以下は、RasterCompare 関数を実行する Python サンプルです。
##====================================
##Raster Compare
##Usage: RasterCompare_management in_base_raster in_test_raster {RASTER_DATASET |
## GDB_RASTER_DATASET | GDB_RASTER_CATALOG |
## MOSAIC_DATASET} {ignore_option;ignore_option...}
## {NO_CONTINUE_COMPARE | CONTINUE_COMPARE}
## {out_compare_file} {Parameter {Tolerance} {Type};
## Parameter {Tolerance} {Type}...} {Field {Tolerance};
## Field {Tolerance}...} {omit_field;omit_field...}
try:
import arcpy
arcpy.env.workspace = "c:/workspace"
##Compare two Raster dataset
arcpy.management.RasterCompare("raster_base.tif","raster_test.tif","RASTER_DATASET",
"","CONTINUE_COMPARE","compareresult.txt","","","")
##Compare two Raster Catalog with ignore options
arcpy.management.RasterCompare("fgdb.gdb/rc_base","fgdb.gdb/rc_test","RASTER_CATALOG",
"IsManaged;Extent","CONTINUE_COMPARE","compareresult2.txt",
"","","DATE")
##Compare two Mosaic Dataset with torelance
arcpy.management.RasterCompare("fgdb.gdb/md_base","fgdb.gdb/md_test","MOSAIC_DATASET",
"IsEmbedded;Seamline","CONTINUE_COMPARE","compareresult3.txt",
"All 0.00001 Fraction","HighPS 0.0001;LowPS 0.0001",
"ItemTS;UriHash")
except:
print("Raster Compare exsample failed.")
print(arcpy.GetMessages())