Image Analyst ライセンスで利用できます。
サマリー
Creates a raster object that contains the difference between two categorical or continuous rasters.
説明
For more information about how this function works, see the Compute Change raster function.
The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.
構文
ComputeChange (raster1, raster2, {method}, {from_class_values}, {to_class_values}, {filter_method}, {define_transition_colors}, {extent_type}, {cellsize_type})
パラメーター | 説明 | データ タイプ |
raster1 | The first raster to be used in the computation. To evaluate change from time 1 (earlier) to time 2 (later), enter the time 1 raster here. | Raster |
raster2 | The second raster to be used in the computation. To evaluate change from time 1 (earlier) to time 2 (later), enter the time 2 raster here. | Raster |
method | Specifies the method to use to compute the difference between the two rasters.
(デフォルト値は次のとおりです DIFFERENCE) | String |
from_class_values [from_class_values,...] | The list of class values from raster1 to include in the computation, if method is set to CATEGORICAL_DIFFERENCE. For example, if you want to identify the areas that changed from Forest to Urban, enter the class value for the Forest class here. If no value is provided, all classes are included. | Integer |
to_class_values [to_class_values,...] | The list of class values from raster2 to include in the computation, if method is set to CATEGORICAL_DIFFERENCE. For example, if you want to identify the areas that changed from Forest to Urban, enter the class value for the Urban class here. If no value is provided, all classes are included. | Integer |
filter_method | Specifies the pixels to categorize in the output raster object, if method is set to CATEGORICAL_DIFFERENCE.
(デフォルト値は次のとおりです CHANGE_PIXELS_ONLY) | String |
define_transition_colors | Specifies the color to use to symbolize class transition categories, if method is set to CATEGORICAL_DIFFERENCE and filter_method is set to either CHANGED_PIXELS_ONLY or ALL.
(デフォルト値は次のとおりです AVERAGE) | String |
extent_type | Specifies the spatial extent used to create the output raster.
(デフォルト値は次のとおりです IntersectionOf) | String |
cellsize_type | Specifies the cell size used to create the output raster.
(デフォルト値は次のとおりです MaxOf) | String |
データ タイプ | 説明 |
Raster | The output raster. |
コードのサンプル
This example computes the difference in specific classes for categorical land cover from 2000 and 2020.
import arcpy
from arcpy.ia import *
arcpy.CheckOutExtension("ImageAnalyst")
raster1 = arcpy.Raster('Landcover_2000.tif')
raster2 = arcpy.Raster('Landcover_2020.tif')
# Compute only the change that occured in land cover between 2000 and 2020
changed_landcover = arcpy.ia.ComputeChange(raster1, raster2,
"CATEGORICAL_DIFFERENCE",[41,42,43],[21,22,23],"CHANGED_PIXELS_ONLY",
"AVERAGE","IntersectionOf","MaxOf")