公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.ImageCollection.cast
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
將 ImageCollection 中每張圖片的部分或所有波段,轉換為指定型別。
用量 | 傳回 |
---|
ImageCollection.cast(bandTypes, bandOrder) | ImageCollection |
引數 | 類型 | 詳細資料 |
---|
這個:collection | ImageCollection | 要投放的圖片集。 |
bandTypes | 字典 | 從樂團名稱到樂團類型的字典。類型可以是 PixelTypes 或字串。有效字串為:'int8'、'int16'、'int32'、'int64'、'uint8'、'uint16'、'uint32'、'byte'、'short'、'int'、'long'、'float' 和 'double'。必須包含集合中任何圖片的所有波段。如果這包括輸入圖片中尚未出現的頻帶,系統會將這些頻帶新增至圖片,並設為透明。 |
bandOrder | 清單 | 清單,指定結果中的波段順序。必須與 bandTypes 的鍵相符。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eCasts image bands within an ImageCollection to specified data types like 'int8', 'float', etc., ensuring uniformity across images.\u003c/p\u003e\n"],["\u003cp\u003eRequires a dictionary mapping band names to desired types and a list defining the output band order.\u003c/p\u003e\n"],["\u003cp\u003eThe process adds any new bands specified in the dictionary as transparent bands to images lacking them.\u003c/p\u003e\n"],["\u003cp\u003eInput band types and order must encompass all existing bands within the ImageCollection to avoid errors.\u003c/p\u003e\n"]]],[],null,["# ee.ImageCollection.cast\n\nCasts some or all bands of each image in an ImageCollection to the specified types.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|----------------------------------------------|-----------------|\n| ImageCollection.cast`(bandTypes, bandOrder)` | ImageCollection |\n\n| Argument | Type | Details |\n|--------------------|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `collection` | ImageCollection | The image collection to cast. |\n| `bandTypes` | Dictionary | A dictionary from band name to band types. Types can be PixelTypes or strings. The valid strings are: 'int8', 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32', 'byte', 'short', 'int', 'long', 'float', and 'double'. Must include all bands already in any image in the collection. If this includes bands that are not already in an input image, they will be added to the image as transparent bands. |\n| `bandOrder` | List | A list specifying the order of the bands in the result. Must match the keys of bandTypes. |"]]