お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ee.Array.reduce
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
指定された各軸に沿ってすべての入力値を Reducer によって計算された単一の出力値に折りたたむことで、配列に Reducer を適用します。
出力は常に入力と同じ次元を持ち、個々の軸は次のように影響を受けます。
「axes」パラメータで指定された軸の長さが 1 に縮小されます(リデューサーを適用することによって)。
リデューサーに複数の入力または複数の出力がある場合、'fieldAxis' で指定された軸を使用して、リデューサーの入力が提供され、リデューサーの出力が保存されます。
他の軸には影響しません(独立した削減が実行されます)。
用途 | 戻り値 |
---|
Array.reduce(reducer, axes, fieldAxis) | 配列 |
引数 | タイプ | 詳細 |
---|
これ: array | 配列 | 配列。 |
reducer | レデューサ | 適用するレデューサ。各出力は、配列やその他の型ではなく、数値である必要があります。 |
axes | リスト | 縮小する軸のリスト。出力の長さは、これらのすべての軸で 1 になります。 |
fieldAxis | 整数、デフォルト: null | リデューサーの入力フィールドと出力フィールドとして使用する軸。リデューサーに複数の入力または複数の出力がある場合にのみ必要です。この場合、軸の長さはリデューサーの入力数と同じでなければなりません。結果の長さはリデューサーの出力数と同じになります。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003e\u003ccode\u003eArray.reduce\u003c/code\u003e collapses input values along specified axes into single output values using a reducer function.\u003c/p\u003e\n"],["\u003cp\u003eThe output array retains the original input dimensionality, with specified axes reduced to length 1.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003efieldAxis\u003c/code\u003e is used when your reducer has multiple inputs or outputs, aligning with those fields.\u003c/p\u003e\n"],["\u003cp\u003eIndependent reductions are performed along all other axes not specified in the \u003ccode\u003eaxes\u003c/code\u003e parameter.\u003c/p\u003e\n"]]],[],null,["# ee.Array.reduce\n\nApply a reducer to an array by collapsing all the input values along each specified axis into a single output value computed by the reducer.\n\n\u003cbr /\u003e\n\nThe output always has the same dimensionality as the input, and the individual axes are affected as follows:\n\n- The axes specified in the 'axes' parameter have their length reduced to 1 (by applying the reducer).\n\n- If the reducer has multiple inputs or multiple outputs, the axis specified in 'fieldAxis' will be used to provide the reducer's inputs and store the reducer's outputs.\n\n- All other axes are unaffected (independent reductions are performed).\n\n| Usage | Returns |\n|----------------------------------------------|---------|\n| Array.reduce`(reducer, axes, `*fieldAxis*`)` | Array |\n\n| Argument | Type | Details |\n|---------------|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `array` | Array | The array. |\n| `reducer` | Reducer | The reducer to apply. Each of its outputs must be a number, not an array or other type. |\n| `axes` | List | The list of axes over which to reduce. The output will have a length of 1 in all these axes. |\n| `fieldAxis` | Integer, default: null | The axis to use as the reducer's input and output fields. Only required if the reducer has multiple inputs or multiple outputs, in which case the axis must have length equal to the number of reducer inputs, and in the result it will have length equal to the number of reducer outputs. |"]]