公告:凡是在 
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取。如未在 2025 年 9 月 26 日前完成驗證,存取權可能會暫停。
  
        
 
       
     
  
  
  
    
  
  
  
    
      ee.Image.select
    
    
      
    
    
      
      透過集合功能整理內容
    
    
      
      你可以依據偏好儲存及分類內容。
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
    
  
  
從圖片中選取波段。
傳回含有所選波段的圖片。
| 用量 | 傳回 | 
|---|
Image.select(var_args) | 圖片 | 
| 引數 | 類型 | 詳細資料 | 
|---|
這個:image | 圖片 | Image 執行個體。 | 
var_args | VarArgs<Object> | 有兩種可能:
-  任意數量的非清單引數。這些都會解讀為頻帶選取器。可以是樂團名稱、規則運算式或數字索引。例如:selected = image.select('a', 'b', 3, 'd');
 
-  兩份清單。第一個會做為樂團選取器,第二個則做為所選樂團的新名稱。新名稱的數量必須與所選樂團數量相符。例如:selected = image.select(['a', 4], ['newA', 'newB']);
 
  | 
  
  
  範例
  
    
  
  
    
    
  
  
  
  
    
    
    
      程式碼編輯器 (JavaScript)
    
    
  // A Sentinel-2 surface reflectance image.
var img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');
print('All band names', img.bandNames());
print('Select a band by name',
      img.select('B11').bandNames());
print('Select a band by index',
      img.select(10).bandNames());
print('Select bands using a list',
      img.select(['B11', 'B8', 'B3']).bandNames());
print('Select bands by an argument series',
      img.select('B11', 'B8', 'B3').bandNames());
print('Mixing string and integer selectors is valid',
      img.select(10, 'B8', 2).bandNames());
print('Rename selected bands using two corresponding lists',
      img.select(['B11', 'B8', 'B3'], ['SWIR1', 'NIR', 'Green']).bandNames());
// Use regular expressions to select bands.
print('Match "QA" followed by any two characters',
      img.select('QA..').bandNames());
print('Match "B" followed by any character, any number of times',
      img.select('B.*').bandNames());
print('Match "B" followed by any character, and any optional third character',
      img.select('B..?').bandNames());
print('Match "B" followed by a character in the range 6-8',
      img.select('B[6-8]').bandNames());
print('Match "B" followed by a character in the range 1-9 and then 1-2',
      img.select('B[1-9][1-2]').bandNames());
print('Match "B" or "QA" each followed by any character, any number of times.',
      img.select('B.*|QA.*').bandNames());
  
    
  
  
    
  
  
  
  
    
  
    
  Python 設定
  請參閱 
    Python 環境頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。
  import ee
import geemap.core as geemap
  
    
    
      Colab (Python)
    
    
  # A Sentinel-2 surface reflectance image.
img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')
display('All band names:', img.bandNames())
display('Select a band by name:', img.select('B11').bandNames())
display('Select a band by index:', img.select(10).bandNames())
display('Select bands using a list:',
      img.select(['B11', 'B8', 'B3']).bandNames())
display('Select bands by an argument series:',
      img.select('B11', 'B8', 'B3').bandNames())
display('Mixing string and integer selectors is valid:',
      img.select(10, 'B8', 2).bandNames())
display('Rename selected bands using two corresponding lists:',
      img.select(['B11', 'B8', 'B3'], ['SWIR1', 'NIR', 'Green'])
      .bandNames())
# Use regular expressions to select bands.
display('Match "QA" followed by any two characters:',
      img.select('QA..').bandNames())
display('Match "B" followed by any character, any number of times:',
      img.select('B.*').bandNames())
display('Match "B" followed by any character, and any optional third character',
      img.select('B..?').bandNames())
display('Match "B" followed by a character in the range 6-8',
      img.select('B[6-8]').bandNames())
display('Match "B" followed by a character in the range 1-9 and then 1-2',
      img.select('B[1-9][1-2]').bandNames())
display('Match "B" or "QA" each followed by any character, any number of times.',
      img.select('B.*|QA.*').bandNames())
  
  
  
  
  
 
  
    
    
      
       
    
    
  
  
  除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
  上次更新時間:2025-10-30 (世界標準時間)。
  
  
  
    
      [null,null,["上次更新時間:2025-10-30 (世界標準時間)。"],[],[]]