To save only the first match for each element in a collection, use an
ee.Join.saveFirst()
. The saveFirst()
join functions in an
equivalent way to the saveAll()
join, except for each element in the
primary
collection, it simply saves the first element from the
secondary
collection matching the condition specified in the
ee.Filter
. Unmatched elements in the primary
collection
are dropped. Unless a sorting property and an order are supplied (as in the
saveAll example), the first element saved might be
any of the elements in the list found by saveAll()
with the same filter.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-05-26 UTC.
[null,null,["Last updated 2021-05-26 UTC."],[[["`ee.Join.saveFirst()` is used to save only the first matching element from a secondary collection to each element in a primary collection."],["It functions similarly to `ee.Join.saveAll()`, but only retains the first match, potentially dropping unmatched primary elements."],["The \"first\" match is arbitrary unless a specific sorting property and order are defined within the join."]]],[]]