DetectChangeUsingChangeAnalysis

Available with Image Analyst license.

Summary

Uses a change analysis raster to create a raster object containing date of change information.

The change analysis raster is generated with the Analyze Changes Using CCDC tool or the Analyze Changes Using LandTrendr tool.

Discussion

For more information on how this function works, see the Detect Change Using Change Analysis 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.

Syntax

DetectChangeUsingChangeAnalysis (raster, {change_type}, {max_number_of_changes}, {segment_date}, {change_direction}, {filter_by_year}, {min_year}, {max_year}, {filter_by_duration}, {min_duration}, {min_duration}, {filter_by_magnitude}, {min_magnitude}, {max_magnitude})
ParameterExplanationData Type
raster

The input change analysis raster generated with the Analyze Changes Using CCDC tool or the Analyze Changes Using LandTrendr tool.

Raster
change_type

Specifies the type of change to be extracted from the change analysis raster.

  • TIME_OF_LATEST_CHANGEEach pixel will contain the date of the most recent change for that pixel in the time series. This is the default.
  • TIME_OF_EARLIEST_CHANGEEach pixel will contain the date of the earliest change for that pixel in the time series.
  • TIME_OF_LARGEST_CHANGEEach pixel will contain the date of the most significant change for that pixel in the time series.
  • NUM_OF_CHANGESEach pixel will contain the total number of times the pixel changed in the time series.
  • TIME_OF_LONGEST_CHANGEEach pixel contains the date of change at the beginning or end of the longest transition segment in the time series.
  • TIME_OF_SHORTEST_CHANGEEach pixel contains the date of change at the beginning or end of the shortest transition segment in the time series.
  • TIME_OF_FASTEST_CHANGEEach pixel contains the date of change at the beginning or end of the transition that occurred most quickly.
  • TIME_OF_SLOWEST_CHANGEEach pixel contains the date of change at the beginning or end of the transition that occurred most slowly.

(The default value is TIME_OF_LATEST_CHANGE)

String
max_number_of_changes

The maximum number of changes per pixel to be calculated. This number corresponds to the number of bands in the output raster. The default is 1, meaning only one change date will be calculated, and the output raster will contain only one band.

This parameter is not available when the change_type parameter is set to NUM_OF_CHANGES.

(The default value is 1)

Integer
segment_date

Specifies whether to extract the date at the beginning of a change segment, or the end.

This parameter is available only when the input change analysis raster is the output from the Analyze Changes Using LandTrendr tool.

  • BEGINNING_OF_SEGMENTExtract the date at the beginning of a change segment. This is the default.
  • END_OF_SEGMENTExtract the date at the end of a change segment.

(The default value is BEGINNING_OF_SEGMENT)

String
change_direction

Specifies the direction of change to be included in the analysis.

This parameter is available only when the input change analysis raster is the output from the Analyze Changes Using LandTrendr tool.

  • ALLAll change directions are included in the output. This is the default.
  • INCREASEOnly change in the positive or increasing direction is included in the output.
  • DECREASEOnly change in the negative or decreasing direction is included in the output.

(The default value is ALL)

String
filter_by_year

Specifies whether to filter by a range of years.

  • True—Filter results so that only changes that occurred within a specific range of years are included in the output.
  • False—Do not filter results by year. This is the default.

(The default value is False)

Boolean
min_year

The earliest year to use to filter results. This parameter is required if the filter_by_year parameter is set to True.

(The default value is 1970)

Double
max_year

The latest year to use to filter results. This parameter is required if the filter_by_year parameter is set to True.

(The default value is 2020)

Double
filter_by_duration

Specifies whether to filter by the duration of a change event.

  • True—Filter results by duration so that only the changes that lasted a given amount of time are included in the output.
  • False—Do not filter results by duration. This is the default.

(The default value is False)

Boolean
min_duration

The minimum number of consecutive years to include in the results. This parameter is required if the filter_by_duration parameter is set to True.

(The default value is 0)

Double
min_duration

The maximum number of consecutive years to include in the results. This parameter is required if the filter_by_duration parameter is set to True.

(The default value is 50)

Double
filter_by_magnitude

Specifies whether to filter by the magnitude of change.

  • True—Filter results by magnitude so that only the changes of a given magnitude are included in the output.
  • False—Do not filter results by magnitude. This is the default.

(The default value is False)

Boolean
min_magnitude

The minimum change magnitude to include in the results. This parameter is required if the filter_by_magnitude parameter is set to True.

(The default value is -50)

Double
max_magnitude

The maximum change magnitude to include in the results. This parameter is required if the filter_by_magnitude parameter is set to True.

(The default value is 50)

Double
Return Value
Data TypeExplanation
Raster

The raster object containing detected change information.

Code sample

DetectChangeUsingChangeAnalysis example

Extracts the dates of change for the three largest changes from the change analysis raster.

import arcpy
from arcpy.ia import *

arcpy.CheckOutExtension("ImageAnalyst")

change_analysis_raster = arcpy.Raster('Landsat_CCDC.crf', True)

# Detect the dates of the three largest changes in pixel values over time
largest_change = arcpy.ia.DetectChangeUsingChangeAnalysis(
	change_analysis_raster, "TIME_OF_LARGEST_CHANGE", 3)