Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
Stay organized with collections
Save and categorize content based on your preferences.
An implementation of the Composite 2 Change (C2C) algorithm. This algorithm segments a time series using a piecewise linear fit with the minimum of segments required to fit the data within the given maximum root mean squared error (RMSE). For every band given the algorithm will return the following bands:
changeDate:A 1D array of doubles representing pairs of start and end dates for each fitted segment. The date format is determined by the dateFormat argument.
value: A 1D array of doubles of the value of the band at the changeDate.
magnitude: A 1D array of doubles providing the absolute difference between the values before and after a change date. The first magnitude is always NaN.
duration: A 1D array of doubles of the duration of the segment preceding the change date. The first duration is always NaN.
rate: A 1D array of doubles of the rate of change of the data preceding the. change date. The first rate is always NaN.
postMagnitude: A 1D array of doubles of the absolute difference between the values after the change date and the value at the change date. The last postMagnitude is always NaN.
postDuration: The duration of the segment following the change date. The last postDuration is always NaN.
postRate: The rate of change of the data following the change date. The last postRate is always NaN.
See Hermosilla et al. (2015) dx.doi.org/10.1016/j.rse.2014.11.005 for further details on the original algorithm.
This algorithm is in preview and is subject to change.
The time representation to use during fitting: 0 = jDays, 1 = fractional years, 2 = unix time in milliseconds. The start, end and break times for each temporal segment will be encoded this way.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-08 UTC."],[],[],null,["An implementation of the Composite 2 Change (C2C) algorithm. This algorithm segments a time series using a piecewise linear fit with the minimum of segments required to fit the data within the given maximum root mean squared error (RMSE). For every band given the algorithm will return the following bands:\n\n\u003cbr /\u003e\n\nchangeDate:A 1D array of doubles representing pairs of start and end dates for each fitted segment. The date format is determined by the dateFormat argument.\n\nvalue: A 1D array of doubles of the value of the band at the changeDate.\n\nmagnitude: A 1D array of doubles providing the absolute difference between the values before and after a change date. The first magnitude is always NaN.\n\nduration: A 1D array of doubles of the duration of the segment preceding the change date. The first duration is always NaN.\n\nrate: A 1D array of doubles of the rate of change of the data preceding the. change date. The first rate is always NaN.\n\npostMagnitude: A 1D array of doubles of the absolute difference between the values after the change date and the value at the change date. The last postMagnitude is always NaN.\n\npostDuration: The duration of the segment following the change date. The last postDuration is always NaN.\n\npostRate: The rate of change of the data following the change date. The last postRate is always NaN.\n\nSee Hermosilla et al. (2015) dx.doi.org/10.1016/j.rse.2014.11.005 for further details on the original algorithm.\n\nThis algorithm is in preview and is subject to change.\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| `ee.Algorithms.TemporalSegmentation.C2c(collection, `*dateFormat* `, `*maxError* `, `*maxSegments* `, `*startYear* `, `*endYear* `, `*infill* `, `*spikesTolerance*`)` | Image |\n\n| Argument | Type | Details |\n|-------------------|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `collection` | ImageCollection | Collection of images on which to run C2C. |\n| `dateFormat` | Integer, default: 0 | The time representation to use during fitting: 0 = jDays, 1 = fractional years, 2 = unix time in milliseconds. The start, end and break times for each temporal segment will be encoded this way. |\n| `maxError` | Float, default: 75 | |\n| `maxSegments` | Integer, default: 6 | |\n| `startYear` | Integer, default: 1984 | |\n| `endYear` | Integer, default: 2019 | |\n| `infill` | Boolean, default: true | |\n| `spikesTolerance` | Float, default: 0.85 | |"]]