إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ee.Array.reduce
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تطبيق أداة تقليل على صفيف من خلال تصغير جميع قيم الإدخال على طول كل محور محدّد إلى قيمة إخراج واحدة يتم احتسابها بواسطة أداة التقليل
يكون الناتج دائمًا بالعدد نفسه من الأبعاد الذي يتضمّنه الإدخال، وتتأثر المحاور الفردية على النحو التالي:
يتم تقليل طول المحاور المحدّدة في المَعلمة "محاور" إلى 1 (من خلال تطبيق أداة الاختزال).
إذا كان المخفّض يتضمّن مدخلات أو مخرجات متعددة، سيتم استخدام المحور المحدّد في fieldAxis لتوفير مدخلات المخفّض وتخزين مخرجاته.
ولا تتأثّر جميع المحاور الأخرى (يتم إجراء عمليات تقليل مستقلة).
الاستخدام | المرتجعات |
---|
Array.reduce(reducer, axes, fieldAxis) | مصفوفة |
الوسيطة | النوع | التفاصيل |
---|
هذا: array | مصفوفة | المصفوفة |
reducer | Reducer | الدالة المخفِّضة التي سيتم تطبيقها. يجب أن يكون كل ناتج من نواتجها رقمًا، وليس مصفوفة أو نوعًا آخر. |
axes | قائمة | قائمة المحاور التي سيتم تقليلها. سيكون طول الناتج 1 في جميع هذه المحاور. |
fieldAxis | عدد صحيح، القيمة التلقائية: null | المحور الذي سيتم استخدامه كحقول الإدخال والإخراج الخاصة ببرنامج تقليل البيانات. لا يكون هذا الحقل مطلوبًا إلا إذا كان المخفّض يتضمّن مدخلات أو مخرجات متعددة، وفي هذه الحالة يجب أن يكون طول المحور مساويًا لعدد مدخلات المخفّض، وأن يكون طوله في النتيجة مساويًا لعدد مخرجات المخفّض. |
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\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. |"]]