Ogłoszenie: wszystkie projekty niekomercyjne zarejestrowane do korzystania z Earth Engine przed
15 kwietnia 2025 r. muszą
potwierdzić spełnianie warunków użycia niekomercyjnego, aby zachować dostęp. Jeśli nie przejdziesz weryfikacji do 26 września 2025 r., Twój dostęp może zostać wstrzymany.
ee.Image.select
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Wybiera pasma z obrazu.
Zwraca obraz z wybranymi pasmami.
| Wykorzystanie | Zwroty |
|---|
Image.select(var_args) | Obraz |
| Argument | Typ | Szczegóły |
|---|
to: image | Obraz | Instancja Image. |
var_args | VarArgs<Object> | Jedna z 2 możliwości:
- Dowolna liczba argumentów, które nie są listami. Wszystkie te elementy będą interpretowane jako selektory pasm. Mogą to być nazwy pasm, wyrażenia regularne lub indeksy liczbowe. Przykład: selected = image.select('a', 'b', 3, 'd');
- 2 listy. Pierwszy będzie używany jako selektor pasma, a drugi jako nowe nazwy wybranych pasm. Liczba nowych nazw musi być zgodna z liczbą wybranych pasm. Np. selected = image.select(['a', 4], ['newA', 'newB']);
|
Przykłady
Edytor kodu (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());
Konfiguracja Pythona
Informacje o interfejsie Python API i używaniu geemap do interaktywnego programowania znajdziesz na stronie
Środowisko Python.
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())
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-10-30 UTC.
[null,null,["Ostatnia aktualizacja: 2025-10-30 UTC."],[],[]]