ee.ImageCollection.limit
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Ogranicza kolekcję do określonej liczby elementów, opcjonalnie sortując je najpierw według określonej właściwości.
Zwraca ograniczoną kolekcję.
Wykorzystanie | Zwroty |
---|
ImageCollection.limit(max, property, ascending) | Kolekcja |
Argument | Typ | Szczegóły |
---|
to: collection | Kolekcja | Instancja kolekcji. |
max | Liczba | Liczba, do której ma być ograniczona kolekcja. |
property | Ciąg znaków, opcjonalnie | Właściwość, według której ma być sortowana lista (jeśli ma być sortowana). |
ascending | Wartość logiczna, opcjonalna | Określa, czy sortować w kolejności rosnącej czy malejącej. Wartość domyślna to true (rosnąco). |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 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). |"]]