ee.ImageCollection.iterate
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Wendet eine vom Nutzer bereitgestellte Funktion auf jedes Element einer Sammlung an. Die vom Nutzer bereitgestellte Funktion erhält zwei Argumente: das aktuelle Element und den Wert, der vom vorherigen Aufruf von „iterate()“ zurückgegeben wurde, oder das erste Argument für die erste Iteration. Das Ergebnis ist der Wert, der vom letzten Aufruf der vom Nutzer bereitgestellten Funktion zurückgegeben wird.
Gibt das Ergebnis des Aufrufs von „Collection.iterate()“ zurück.
Nutzung | Ausgabe |
---|
ImageCollection.iterate(algorithm, first) | ComputedObject |
Argument | Typ | Details |
---|
So gehts: collection | Sammlung | Die Sammlung. |
algorithm | Funktion | Die Funktion, die auf jedes Element angewendet werden soll. Muss zwei Argumente annehmen: ein Element der Sammlung und den Wert aus der vorherigen Iteration. |
first | Objekt, optional | Der Ausgangszustand. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\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. |"]]