Earth Engine telah memperkenalkan
tingkat kuota nonkomersial untuk melindungi resource komputasi bersama dan memastikan performa yang andal bagi semua orang. Project nonkomersial menggunakan Tingkat Komunitas secara default, meskipun Anda dapat mengubah tingkat project kapan saja.
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
ee.List.filter
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Memfilter daftar hanya ke elemen yang cocok dengan filter yang diberikan. Untuk memfilter item daftar yang bukan gambar atau fitur, uji properti bernama 'item', misalnya, ee.Filter.gt('item', 3).
| Penggunaan | Hasil |
|---|
List.filter(filter) | Daftar |
| Argumen | Jenis | Detail |
|---|
ini: list | Daftar | |
filter | Filter | |
Contoh
Editor Kode (JavaScript)
// An ee.Image list object.
var list = ee.List([1, 2, 3, null, 6, 7]);
// Filter the list by a variety of conditions. Note that the property name
// 'item' is used to refer to list elements in ee.Filter functions.
print('List items equal to 3',
list.filter(ee.Filter.eq('item', 3)));
print('List items greater than 4',
list.filter(ee.Filter.gt('item', 4)));
print('List items not null',
list.filter(ee.Filter.notNull(['item'])));
print('List items in another list',
list.filter(ee.Filter.inList('item', [1, 98, 99])));
print('List items 3 ≤ 𝑥 ≤ 6',
list.filter(ee.Filter.and(
ee.Filter.gte('item', 3),
ee.Filter.lte('item', 6))));
Penyiapan Python
Lihat halaman
Lingkungan Python untuk mengetahui informasi tentang Python API dan penggunaan
geemap untuk pengembangan interaktif.
import ee
import geemap.core as geemap
Colab (Python)
# An ee.Image list object.
ee_list = ee.List([1, 2, 3, None, 6, 7])
# Filter the list by a variety of conditions. Note that the property name
# 'item' is used to refer to list elements in ee.Filter functions.
display('List items equal to 3:',
ee_list.filter(ee.Filter.eq('item', 3)))
display('List items greater than 4:',
ee_list.filter(ee.Filter.gt('item', 4)))
display('List items not None:',
ee_list.filter(ee.Filter.notNull(['item'])))
display('List items in another list:',
ee_list.filter(ee.Filter.inList('item', [1, 98, 99])))
display('List items 3 ≤ 𝑥 ≤ 6:',
ee_list.filter(ee.Filter.And(
ee.Filter.gte('item', 3),
ee.Filter.lte('item', 6))))
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-10-30 UTC.
[null,null,["Terakhir diperbarui pada 2025-10-30 UTC."],[],["The `List.filter(filter)` method filters a list, returning a new list containing only elements that match the provided filter. Elements are referenced by the property name 'item' within `ee.Filter` functions. Filters can test for equality (`eq`), greater than (`gt`), not null (`notNull`), inclusion in another list (`inList`), and combined conditions using `and`. Examples show how to filter numerical lists in both JavaScript and Python using these comparison operations.\n"]]