公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.regexpRename
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
通过对当前波段名称应用正则表达式替换来重命名映像的波段。未与正则表达式匹配的任何频段都将复制过来,而不会重命名。
用法 | 返回 |
---|
Image.regexpRename(regex, replacement, all) | 图片 |
参数 | 类型 | 详细信息 |
---|
此:input | 图片 | 包含要重命名的波段的图片。 |
regex | 字符串 | 用于在每个频段名称中进行匹配的正则表达式。 |
replacement | 字符串 | 用于替换每个匹配项的文本。支持用于捕获值的 $n 语法。 |
all | 布尔值,默认值:true | 如果为 true,则替换给定字符串中的所有匹配项。否则,系统只会替换每个字符串中的第一个匹配项。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],["This functionality renames image bands using regular expressions. It takes an image, a `regex` to match band names, and a `replacement` string (supporting captured groups via `$n`). Bands not matching the `regex` remain unchanged. An optional `all` parameter (defaulting to `true`) determines whether to replace all regex matches or just the first one per band name. The function returns a new image with the updated band names.\n"],null,[]]