공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ee.Array.reduce
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
지정된 각 축을 따라 모든 입력 값을 감소기로 계산된 단일 출력 값으로 축소하여 배열에 감소기를 적용합니다.
출력은 항상 입력과 동일한 차원성을 가지며 개별 축은 다음과 같이 영향을 받습니다.
'axes' 매개변수에 지정된 축의 길이가 리듀서를 적용하여 1로 감소합니다.
리듀서에 입력이 여러 개 있거나 출력이 여러 개 있는 경우 'fieldAxis'에 지정된 축이 리듀서의 입력을 제공하고 리듀서의 출력을 저장하는 데 사용됩니다.
다른 모든 축은 영향을 받지 않습니다 (독립적인 감소가 실행됨).
사용 | 반환 값 |
---|
Array.reduce(reducer, axes, fieldAxis) | 배열 |
인수 | 유형 | 세부정보 |
---|
다음과 같은 경우: array | 배열 | 배열입니다. |
reducer | 감소기 | 적용할 리듀서입니다. 각 출력은 배열이나 다른 유형이 아닌 숫자여야 합니다. |
axes | 목록 | 축소할 축의 목록입니다. 출력의 길이는 이러한 모든 축에서 1입니다. |
fieldAxis | 정수, 기본값: null | 리듀서의 입력 및 출력 필드로 사용할 축입니다. 리듀서에 입력이 여러 개 있거나 출력이 여러 개 있는 경우에만 필요합니다. 이 경우 축의 길이는 리듀서 입력 수와 같아야 하며 결과에서 길이는 리듀서 출력 수와 같습니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 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. |"]]