Pengumuman : Semua project nonkomersial yang terdaftar untuk menggunakan Earth Engine sebelum
15 April 2025 harus
memverifikasi kelayakan nonkomersial untuk mempertahankan akses. Jika Anda belum melakukan verifikasi hingga 26 September 2025, akses Anda mungkin ditangguhkan.
Kirim masukan
ee.ImageCollection.select
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Pilih rentang dari setiap gambar dalam koleksi.
Menampilkan koleksi gambar dengan band yang dipilih.
Penggunaan Hasil ImageCollection. select (selectors, names )
ImageCollection
Argumen Jenis Detail ini: imagecollection
ImageCollection Instance ImageCollection. selectors
List<Object> Daftar nama, ekspresi reguler, atau indeks numerik yang menentukan band yang akan dipilih. names
List<String>, opsional Daftar nama baru untuk band output. Harus cocok dengan jumlah band yang dipilih.
Contoh
Code Editor (JavaScript)
// A Sentinel-2 surface reflectance image collection.
var col = ee . ImageCollection ( 'COPERNICUS/S2_SR' )
. filterBounds ( ee . Geometry . Point ( - 122.152 , 37.336 ))
. filterDate ( '2021-01-01' , '2021-02-01' );
print ( 'All band names' , col . first (). bandNames ());
print ( 'Select a band by name' ,
col . select ( 'B11' ). first (). bandNames ());
print ( 'Select a band by index' ,
col . select ( 10 ). first (). bandNames ());
print ( 'Select bands using a list' ,
col . select ([ 'B11' , 'B8' , 'B3' ]). first (). bandNames ());
print ( 'Select bands by an argument series' ,
col . select ( 'B11' , 'B8' , 'B3' ). first (). bandNames ());
print ( 'Mixing string and integer selectors is valid' ,
col . select ( 10 , 'B8' , 2 ). first (). bandNames ());
print ( 'Rename selected bands using two corresponding lists' ,
col . select ([ 'B11' , 'B8' , 'B3' ], [ 'SWIR1' , 'NIR' , 'Green' ])
. first (). bandNames ());
// Use regular expressions to select bands.
print ( 'Match "QA" followed by any two characters' ,
col . select ( 'QA..' ). first (). bandNames ());
print ( 'Match "B" followed by any character, any number of times' ,
col . select ( 'B.*' ). first (). bandNames ());
print ( 'Match "B" followed by any character, and any optional third character' ,
col . select ( 'B..?' ). first (). bandNames ());
print ( 'Match "B" followed by a character in the range 6-8' ,
col . select ( 'B[6-8]' ). first (). bandNames ());
print ( 'Match "B" followed by a character in the range 1-9 and then 1-2' ,
col . select ( 'B[1-9][1-2]' ). first (). bandNames ());
print ( 'Match "B" or "QA" each followed by any character, any number of times.' ,
col . select ( 'B.*|QA.*' ). first (). bandNames ());
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)
# A Sentinel-2 surface reflectance image collection.
col = ee . ImageCollection ( 'COPERNICUS/S2_SR' ) . filterBounds (
ee . Geometry . Point ( - 122.152 , 37.336 )
) . filterDate ( '2021-01-01' , '2021-02-01' )
print ( 'All band names' , col . first () . bandNames () . getInfo ())
print ( 'Select a band by name:' ,
col . select ( 'B11' ) . first () . bandNames () . getInfo ())
print ( 'Select a band by index:' ,
col . select ( 10 ) . first () . bandNames () . getInfo ())
print ( 'Select bands using a list:' ,
col . select ([ 'B11' , 'B8' , 'B3' ]) . first () . bandNames () . getInfo ())
print ( 'Select bands by an argument series:' ,
col . select ( 'B11' , 'B8' , 'B3' ) . first () . bandNames () . getInfo ())
print ( 'Mixing string and integer selectors is valid:' ,
col . select ( 10 , 'B8' , 2 ) . first () . bandNames () . getInfo ())
print ( 'Rename selected bands using two corresponding lists:' ,
col . select ([ 'B11' , 'B8' , 'B3' ], [ 'SWIR1' , 'NIR' , 'Green' ])
. first () . bandNames () . getInfo ())
# Use regular expressions to select bands.
print ( 'Match "QA" followed by any two characters:' ,
col . select ( 'QA..' ) . first () . bandNames () . getInfo ())
print ( 'Match "B" followed by any character, any number of times:' ,
col . select ( 'B.*' ) . first () . bandNames () . getInfo ())
print ( 'Match "B" followed by any character, and any optional third character:' ,
col . select ( 'B..?' ) . first () . bandNames () . getInfo ())
print ( 'Match "B" followed by a character in the range 6-8:' ,
col . select ( 'B[6-8]' ) . first () . bandNames () . getInfo ())
print ( 'Match "B" followed by a character in the range 1-9 and then 1-2:' ,
col . select ( 'B[1-9][1-2]' ) . first () . bandNames () . getInfo ())
print ( 'Match "B" or "QA" each followed by any character, any number of times:' ,
col . select ( 'B.*|QA.*' ) . first () . bandNames () . getInfo ())
Kirim masukan
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-07-25 UTC.
Ada masukan untuk kami?
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-25 UTC."],[],["The `select` method extracts specific bands from an ImageCollection, returning a new ImageCollection with those bands. Band selection can be done by name, index, or a list of these. New band names can be assigned using an optional list, which must match the number of selected bands. Regular expressions can also be used to select bands based on pattern matching. The code examples demonstrate these selection techniques for both JavaScript and Python.\n"]]