ee.ImageCollection.iterate
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک تابع ارائه شده توسط کاربر را برای هر عنصر از مجموعه اعمال می کند. تابع ارائه شده توسط کاربر دو آرگومان داده می شود: عنصر فعلی، و مقداری که توسط فراخوانی قبلی به iterate() یا اولین آرگومان برگردانده شده است، برای تکرار اول. نتیجه مقداری است که با فراخوانی نهایی به تابع ارائه شده توسط کاربر برگردانده می شود.
نتیجه فراخوانی Collection.iterate() را برمی گرداند.
استفاده | برمی گرداند | ImageCollection. iterate (algorithm, first ) | Computed Object |
استدلال | تایپ کنید | جزئیات | این: collection | مجموعه | نمونه مجموعه |
algorithm | تابع | تابعی که باید برای هر عنصر اعمال شود. باید دو آرگومان بگیرد: یک عنصر از مجموعه و مقدار از تکرار قبلی. |
first | شیء، اختیاری | حالت اولیه. |
،
یک تابع ارائه شده توسط کاربر را برای هر عنصر از مجموعه اعمال می کند. تابع ارائه شده توسط کاربر دو آرگومان داده می شود: عنصر فعلی، و مقداری که توسط فراخوانی قبلی به iterate() یا اولین آرگومان برگردانده شده است، برای تکرار اول. نتیجه مقداری است که با فراخوانی نهایی به تابع ارائه شده توسط کاربر برگردانده می شود.
نتیجه فراخوانی Collection.iterate() را برمی گرداند.
استفاده | برمی گرداند | ImageCollection. iterate (algorithm, first ) | Computed Object |
استدلال | تایپ کنید | جزئیات | این: collection | مجموعه | نمونه مجموعه |
algorithm | تابع | تابعی که باید برای هر عنصر اعمال شود. باید دو آرگومان بگیرد: یک عنصر از مجموعه و مقدار از تکرار قبلی. |
first | شیء، اختیاری | حالت اولیه. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eApplies a custom function iteratively to each element of a collection, using the previous result in each subsequent calculation.\u003c/p\u003e\n"],["\u003cp\u003eReturns the final computed value after applying the function across all elements.\u003c/p\u003e\n"],["\u003cp\u003eBegins with an initial state (optional) and updates it based on the user-provided function and each element in the collection.\u003c/p\u003e\n"],["\u003cp\u003eUseful for implementing custom algorithms or calculations across collections like ImageCollections.\u003c/p\u003e\n"]]],["`iterate()` applies a user-defined function to each collection element. This function receives the current element and the prior iteration's result as arguments. The process starts with an optional initial state (`first`). The final output is the value produced by the user-defined function's last execution. It's used on a `Collection` with the `algorithm` being a function and `first` as optional. It returns a `ComputedObject`.\n"],null,["# ee.ImageCollection.iterate\n\n\u003cbr /\u003e\n\nApplies a user-supplied function to each element of a collection. The user-supplied function is given two arguments: the current element, and the value returned by the previous call to iterate() or the first argument, for the first iteration. The result is the value returned by the final call to the user-supplied function.\n\n\u003cbr /\u003e\n\nReturns the result of the Collection.iterate() call.\n\n| Usage | Returns |\n|-------------------------------------------------|----------------|\n| ImageCollection.iterate`(algorithm, `*first*`)` | ComputedObject |\n\n| Argument | Type | Details |\n|--------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| this: `collection` | Collection | The Collection instance. |\n| `algorithm` | Function | The function to apply to each element. Must take two arguments: an element of the collection and the value from the previous iteration. |\n| `first` | Object, optional | The initial state. |"]]