Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
ee.ImageCollection.limit
Stay organized with collections
Save and categorize content based on your preferences.
Limit a collection to the specified number of elements, optionally sorting them by a specified property first.
Returns the limited collection.
Usage | Returns | ImageCollection.limit(max, property, ascending) | Collection |
Argument | Type | Details | this: collection | Collection | The Collection instance. |
max | Number | The number to limit the collection to. |
property | String, optional | The property to sort by, if sorting. |
ascending | Boolean, optional | Whether to sort in ascending or descending order. The default is true (ascending). |
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 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["\u003cp\u003eLimits the number of elements within a collection to a specified maximum.\u003c/p\u003e\n"],["\u003cp\u003eOptionally sorts the collection by a given property before limiting the results, in either ascending or descending order.\u003c/p\u003e\n"],["\u003cp\u003eReturns the modified collection with the applied limit and optional sorting.\u003c/p\u003e\n"]]],["The `limit` method restricts a collection to a specified number of elements (`max`). It optionally sorts the collection beforehand by a given `property`. Sorting can be in ascending (default) or descending order, controlled by the `ascending` argument. The method operates on a `Collection` instance and returns the modified, limited `Collection`. The method requires a number for max and accepts an optional String for the property to sort by and an optional boolean for the sort direction.\n"],null,["# ee.ImageCollection.limit\n\n\u003cbr /\u003e\n\nLimit a collection to the specified number of elements, optionally sorting them by a specified property first.\n\n\u003cbr /\u003e\n\nReturns the limited collection.\n\n| Usage | Returns |\n|------------------------------------------------------------|------------|\n| ImageCollection.limit`(max, `*property* `, `*ascending*`)` | Collection |\n\n| Argument | Type | Details |\n|--------------------|-------------------|------------------------------------------------------------------------------------|\n| this: `collection` | Collection | The Collection instance. |\n| `max` | Number | The number to limit the collection to. |\n| `property` | String, optional | The property to sort by, if sorting. |\n| `ascending` | Boolean, optional | Whether to sort in ascending or descending order. The default is true (ascending). |"]]