公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Reducer.combine
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建一个并行运行两个 reducer 的 Reducer。组合后的 reducer 的输出将是 reducer1 的输出,后跟 reducer2 的输出,其中 reducer2 的输出名称带有指定的前缀。
如果 sharedInputs 为 true,则缩减器的输入数量必须相同,并且合并后的缩减器的输入数量将与它们相同;如果为 false,则合并后的缩减器的输入将是 reducer1 的输入,后跟 reducer2 的输入。
用法 | 返回 |
---|
Reducer.combine(reducer2, outputPrefix, sharedInputs) | 缩减器 |
参数 | 类型 | 详细信息 |
---|
此:reducer1 | 缩减器 | 第一个缩减器。 |
reducer2 | 缩减器 | 第二个缩减器。 |
outputPrefix | 字符串,默认值:"" | reducer2 的输出名称的前缀。 |
sharedInputs | 布尔值,默认值:false | reducer 是否共享输入。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eCreates a combined Reducer by running two reducers (reducer1 and reducer2) concurrently, with the outputs of reducer1 preceding those of reducer2.\u003c/p\u003e\n"],["\u003cp\u003eOutputs of reducer2 are prefixed with a specified string to differentiate them from reducer1's outputs.\u003c/p\u003e\n"],["\u003cp\u003eInput handling for the combined reducer is configurable: if \u003ccode\u003esharedInputs\u003c/code\u003e is true, both reducers utilize the same inputs; otherwise, the combined reducer's inputs are those of reducer1 followed by those of reducer2.\u003c/p\u003e\n"],["\u003cp\u003eIt can be invoked using \u003ccode\u003eReducer.combine()\u003c/code\u003e method, accepting reducer2, output prefix, and shared input preference as arguments.\u003c/p\u003e\n"]]],[],null,["# ee.Reducer.combine\n\nCreates a Reducer that runs two reducers in parallel. The combined reducer's outputs will be those of reducer1 followed by those of reducer2, where the output names of reducer2 are prefixed with the given string.\n\n\u003cbr /\u003e\n\nIf sharedInputs is true, the reducers must have the same number of inputs, and the combined reducer's will match them; if it is false, the inputs of the combined reducer will be those of reducer1 followed by those of reducer2.\n\n| Usage | Returns |\n|------------------------------------------------------------------|---------|\n| Reducer.combine`(reducer2, `*outputPrefix* `, `*sharedInputs*`)` | Reducer |\n\n| Argument | Type | Details |\n|------------------|-------------------------|-------------------------------------|\n| this: `reducer1` | Reducer | The first reducer. |\n| `reducer2` | Reducer | The second reducer. |\n| `outputPrefix` | String, default: \"\" | Prefix for reducer2's output names. |\n| `sharedInputs` | Boolean, default: false | Whether the reducers share inputs. |"]]