公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Algorithms.TemporalSegmentation.StructuralChangeBreakpoints
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
執行中斷點偵測,類似於 R 的 strucchange::breakpoints 函式。
每個像素都以分段線性/諧波模型擬合,形式如下:
Y = A + B * t + C * cos(2 * pi * season(t)) + D * sin(2 * pi * season(t)) + E * cos(4 * pi * season(t)) + F * sin(4 * pi * season(t)) + ...
在這個方程式中,「t」是圖片的開始時間,格式由「dateFormat」指定,而「season(t)」是該開始時間的分數年份 (詳情請參閱 dateFormat 的說明)。諧波項的最大階數是由「seasonalModelOrder」決定。
結果會是包含兩條帶子的圖片,以及輸入內容中每條帶子各兩條帶子:
tStart
、tEnd
:這些項目各包含一個 1D 陣列,其中每個項目對應分段線性擬合中的一個區段,且每個項目都包含該區段中第一張或最後一張圖片的開始時間。根據預設,這裡的值會以年為單位 (含小數),方便與係數搭配使用。
coefs_BANDNAME
:每個輸入頻帶都會有一個輸出頻帶。每個陣列都包含一個 2D 陣列,每個區段各有一列。該列中的值是該區隔的線性擬合係數,也就是該區隔的 A、B、C 等值。如上所述,這裡的值會受到「dateFormat」影響
。rmse_BANDNAME
:每個輸入頻帶都會有一個輸出頻帶。這個陣列包含一維陣列,每個區隔各有一個項目。每個區隔的值都是該區隔的線性擬合殘差 RMSE。
用量 | 傳回 |
---|
ee.Algorithms.TemporalSegmentation.StructuralChangeBreakpoints(collection, breakpointBand, seasonalModelOrder, minSpacing, maxBreaks, dateFormat) | 圖片 |
引數 | 類型 | 詳細資料 |
---|
collection | ImageCollection | 用來偵測中斷點的圖片集合。 |
breakpointBand | 字串,預設值為空值 | 用於偵測中斷點的頻帶名稱。如果圖片只有單一頻帶,則為選填。 |
seasonalModelOrder | 整數,預設值為 3 | 諧波季節性模型的階數。 |
minSpacing | 浮點值,預設值為 0.15 | 中斷點之間的最小間距。如果這個值介於 0 和 1 之間 (不含 0 和 1),系統會將其解讀為集合中圖片數量的分數。否則系統會將其解讀為樣本數。 |
maxBreaks | 整數,預設值為 0 | 中斷點數量上限。 |
dateFormat | 整數,預設值為 1 | 要在結果中使用的時間表示法:1 = 分數年,2 = 以毫秒為單位的 Unix 時間。這會影響 tStart 和 tEnd 頻帶中的值,以及用於諧波模型中的「t」值。這裡和該模型中使用的分數年數,定義為自 1970 年 1 月 1 日起,以 365.25 天為單位的年數。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eDetects breakpoints in an image collection using a piecewise linear/harmonic model, similar to R's \u003ccode\u003estrucchange::breakpoints\u003c/code\u003e function.\u003c/p\u003e\n"],["\u003cp\u003eOutputs an image with bands indicating breakpoint start/end times, model coefficients for each segment, and RMSE for each segment's fit.\u003c/p\u003e\n"],["\u003cp\u003eAllows customization of the harmonic model's order, minimum breakpoint spacing, maximum number of breakpoints, and time representation format.\u003c/p\u003e\n"],["\u003cp\u003eUses a model that incorporates a linear trend and seasonal harmonics to fit pixel values over time.\u003c/p\u003e\n"],["\u003cp\u003eThe algorithm identifies the optimal breakpoints by minimizing the residual error of the piecewise model.\u003c/p\u003e\n"]]],["The function `StructuralChangeBreakpoints` detects breakpoints in an image collection, fitting each pixel with a piecewise linear/harmonic model. Input parameters include `collection`, `breakpointBand`, `seasonalModelOrder`, `minSpacing`, `maxBreaks`, and `dateFormat`. The output image contains `tStart` and `tEnd` bands, which hold segment start and end times. Additionally, there are `coefs_BANDNAME` bands, that contain linear fit coefficients and `rmse_BANDNAME` bands with the root-mean-square error for each segment.\n"],null,["# ee.Algorithms.TemporalSegmentation.StructuralChangeBreakpoints\n\nRuns breakpoint detection, similar to R's strucchange::breakpoints function.\n\n\u003cbr /\u003e\n\nEach pixel is fit by a piecewise linear/harmonic model, of the form\n\nY = A + B \\* t + C \\* cos(2 \\* pi \\* season(t)) + D \\* sin(2 \\* pi \\* season(t)) + E \\* cos(4 \\* pi \\* season(t)) + F \\* sin(4 \\* pi \\* season(t)) + ...\n\nIn this equation, 't' is the start time of the image in the format specified by 'dateFormat', and 'season(t)' is the fractional year of that start time (see the description of dateFormat for details). The maximum order of the harmonic terms is determined by 'seasonalModelOrder'.\n\nThe result is an image containing two bands, plus two bands per band in the input:\n\n`tStart`, `tEnd`: each of these holds a 1D array, with one entry per segment in the piecewise linear fit; each entry contains the start time of the first or last images in that segment. By default the values here are in fractional years, for easy use with the coefficients.\n\n`coefs_BANDNAME`: there will be one such output band per input band. Each of these holds a 2D array, with one row per segment. The values in that row are the coefficients of the linear fit for that segment - that is, the values of A, B, C, ... for that segment. As described above, the values here are affected by 'dateFormat'\n\n.`rmse_BANDNAME`: there will be one such output band per input band. This holds a 1D array, with one entry per segment. The value for each segment is the RMSE for the linear fit residuals for that segment.\n\n| Usage | Returns |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| `ee.Algorithms.TemporalSegmentation.StructuralChangeBreakpoints(collection, `*breakpointBand* `, `*seasonalModelOrder* `, `*minSpacing* `, `*maxBreaks* `, `*dateFormat*`)` | Image |\n\n| Argument | Type | Details |\n|----------------------|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `collection` | ImageCollection | Collection of images on which to detect breakpoints. |\n| `breakpointBand` | String, default: null | The name of the band to use for breakpoint detection. Optional only if the images have only a single band. |\n| `seasonalModelOrder` | Integer, default: 3 | The order of the harmonic seasonal model. |\n| `minSpacing` | Float, default: 0.15 | The minimum spacing between breakpoints. If this is between 0 and 1 (exclusive), it will be interpreted as a fraction of the number of images in the collection. Otherwise, it will be interpreted as a number of samples. |\n| `maxBreaks` | Integer, default: 0 | The maximum number of breakpoints. |\n| `dateFormat` | Integer, default: 1 | The time representation to use in the results: 1 = fractional years, 2 = unix time in milliseconds. This affects the values in the tStart and tEnd bands and the 't' values used in the harmonic model. The fractional years used here and in that model are defined as the fractional number of 365.25-day years since 1 Jan 1970. |"]]