公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.ImageCollection.reduce
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
對集合中的所有圖片套用縮減函式。
如果縮減函式只有一個輸入,系統會分別套用至集合的每個波段;否則,輸入數量必須與集合的波段數量相同。
化簡器輸出名稱會決定輸出波段的名稱:有多個輸入內容的化簡器會直接使用輸出名稱,而只有一個輸入內容的化簡器則會在輸出名稱前加上輸入波段名稱 (例如 '10_mean', '20_mean')。
用量 | 傳回 |
---|
ImageCollection.reduce(reducer, parallelScale) | 圖片 |
引數 | 類型 | 詳細資料 |
---|
這個:collection | ImageCollection | 要縮減的圖片集合。 |
reducer | 縮減函式 | 要套用至指定集合的縮減函式。 |
parallelScale | 浮點值,預設值為 1 | 用於限制記憶體用量的縮放比例因數;使用較大的 parallelScale (例如 2 或 4) 可能會啟用運算,導致記憶體不足。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[[["\u003cp\u003eApplies a reducer function across all images within an ImageCollection, resulting in a single output Image.\u003c/p\u003e\n"],["\u003cp\u003eReducers can operate on individual bands or multiple bands simultaneously, determining the output band names accordingly.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes a parallelScale factor to manage memory consumption during computation.\u003c/p\u003e\n"],["\u003cp\u003eAccess this functionality via the \u003ccode\u003eImageCollection.reduce()\u003c/code\u003e method, providing the reducer and optional parallelScale as parameters.\u003c/p\u003e\n"]]],[],null,["# ee.ImageCollection.reduce\n\nApplies a reducer across all of the images in a collection.\n\n\u003cbr /\u003e\n\nIf the reducer has a single input, it will be applied separately to each band of the collection; otherwise it must have the same number of inputs as the collection has bands.\n\nThe reducer output names determine the names of the output bands: reducers with multiple inputs will use the output names directly, while reducers with a single input will prefix the output name with the input band name (e.g., '10_mean', '20_mean').\n\n| Usage | Returns |\n|------------------------------------------------------|---------|\n| ImageCollection.reduce`(reducer, `*parallelScale*`)` | Image |\n\n| Argument | Type | Details |\n|--------------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `collection` | ImageCollection | The image collection to reduce. |\n| `reducer` | Reducer | The reducer to apply to the given collection. |\n| `parallelScale` | Float, default: 1 | A scaling factor used to limit memory use; using a larger parallelScale (e.g., 2 or 4) may enable computations that run out of memory with the default. |"]]