Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
Stay organized with collections
Save and categorize content based on your preferences.
Applies 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.
Returns the result of the Collection.iterate() call.
Usage
Returns
FeatureCollection.iterate(algorithm, first)
ComputedObject
Argument
Type
Details
this: collection
Collection
The Collection instance.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."],[[["\u003cp\u003e\u003ccode\u003eFeatureCollection.iterate()\u003c/code\u003e applies a custom function iteratively to each element of a FeatureCollection, using the output of the previous iteration as input for the next.\u003c/p\u003e\n"],["\u003cp\u003eIt allows for accumulating or aggregating data across features, enabling operations like cumulative sums or sequential processing.\u003c/p\u003e\n"],["\u003cp\u003eThe user-provided function receives the current element and the previous iteration's result, returning a value used in the next step.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFeatureCollection.iterate()\u003c/code\u003e can be less efficient than \u003ccode\u003emap()\u003c/code\u003e or array-based methods for certain tasks, so consider alternatives if performance is critical.\u003c/p\u003e\n"],["\u003cp\u003eThe final output is the result of the last function call, typically a modified FeatureCollection or a computed value.\u003c/p\u003e\n"]]],[],null,[]]