公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.cast
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将图像的部分或全部波段强制转换为指定类型。
用法 | 返回 |
---|
Image.cast(bandTypes, bandOrder) | 图片 |
参数 | 类型 | 详细信息 |
---|
此:image | 图片 | 要投放的图片。 |
bandTypes | 字典 | 一个从频段名称到频段类型的字典。类型可以是 PixelTypes 或字符串。有效的字符串包括:'int8'、'int16'、'int32'、'int64'、'uint8'、'uint16'、'uint32'、'byte'、'short'、'int'、'long'、'float' 和 'double'。如果 bandTypes 包含输入图片中尚不存在的波段,则这些波段将作为透明波段添加到图片中。如果未同时指定 bandOrder,则新频段将按字母顺序附加。 |
bandOrder | 列表,默认值:null | 一个列表,用于指定结果中波段的顺序。如果指定,则必须与结果中的完整频段列表相匹配。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],["The `Image.cast` function modifies an image by changing the data type of its bands. It takes a dictionary, `bandTypes`, mapping band names to new data types (PixelTypes or strings like 'int8', 'float'). If a specified band is not present in the original image, a transparent band of that type is added. An optional `bandOrder` list defines the sequence of the resulting bands. The function returns the modified `Image`.\n"],null,[]]