Earth Engine ขอแนะนำ
ระดับโควต้าที่ไม่ใช่เชิงพาณิชย์เพื่อปกป้องทรัพยากรการประมวลผลที่ใช้ร่วมกันและรับประกันประสิทธิภาพที่เชื่อถือได้สำหรับทุกคน โปรเจ็กต์ที่ไม่ใช่เชิงพาณิชย์ทั้งหมดจะต้องเลือกระดับโควต้าภายในวันที่
27 เมษายน 2026 หรือจะใช้ระดับชุมชนโดยค่าเริ่มต้นก็ได้ โควต้าระดับจะมีผลกับโปรเจ็กต์ทั้งหมด (ไม่ว่าวันที่เลือกระดับจะเป็นวันใด) ในวันที่
27 เมษายน 2026 ดูข้อมูลเพิ่มเติม
ee.ImageCollection.select
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เลือกแถบจากแต่ละภาพในคอลเล็กชัน
แสดงผลคอลเล็กชันรูปภาพที่มีแบนด์ที่เลือก
| การใช้งาน | การคืนสินค้า |
|---|
ImageCollection.select(selectors, names) | ImageCollection |
| อาร์กิวเมนต์ | ประเภท | รายละเอียด |
|---|
imagecollection | ImageCollection | อินสแตนซ์ ImageCollection |
selectors | List[Object] | รายการชื่อ นิพจน์ทั่วไป หรือดัชนีตัวเลขที่ระบุแถบความถี่ที่จะเลือก |
names | List[String], ไม่บังคับ | รายการชื่อใหม่สำหรับแถบเอาต์พุต ต้องตรงกับจำนวนแถบที่เลือก |
ตัวอย่าง
ตัวแก้ไขโค้ด (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());
การตั้งค่า Python
ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้าสภาพแวดล้อม Python
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')
display('All band names', col.first().bandNames())
display('Select a band by name:',
col.select('B11').first().bandNames())
display('Select a band by index:',
col.select(10).first().bandNames())
display('Select bands using a list:',
col.select(['B11', 'B8', 'B3']).first().bandNames())
display('Select bands by an argument series:',
col.select('B11', 'B8', 'B3').first().bandNames())
display('Mixing string and integer selectors is valid:',
col.select(10, 'B8', 2).first().bandNames())
display('Rename selected bands using two corresponding lists:',
col.select(['B11', 'B8', 'B3'], ['SWIR1', 'NIR', 'Green'])
.first().bandNames())
# Use regular expressions to select bands.
display('Match "QA" followed by any two characters:',
col.select('QA..').first().bandNames())
display('Match "B" followed by any character, any number of times:',
col.select('B.*').first().bandNames())
display('Match "B" followed by any character, and any optional third character:',
col.select('B..?').first().bandNames())
display('Match "B" followed by a character in the range 6-8:',
col.select('B[6-8]').first().bandNames())
display('Match "B" followed by a character in the range 1-9 and then 1-2:',
col.select('B[1-9][1-2]').first().bandNames())
display('Match "B" or "QA" each followed by any character, any number of times:',
col.select('B.*|QA.*').first().bandNames())
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2026-01-08 UTC
[null,null,["อัปเดตล่าสุด 2026-01-08 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"]]