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.rename
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
zmieniać nazwy pasm obrazu,
Zwraca obraz po zmianie nazwy.
| Wykorzystanie | Zwroty |
|---|
Image.rename(var_args) | Obraz |
| Argument | Typ | Szczegóły |
|---|
to: image | Obraz | Instancja Image. |
var_args | List<String>|Object|VarArgs<String> | Nowe nazwy pasm. Musi być zgodna z liczbą pasm na obrazie. |
Przykłady
Edytor kodu (JavaScript)
// A Sentinel-2 surface reflectance image.
var img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')
.select(['B11', 'B8', 'B3']);
print('Original selected S2 image band names', img.bandNames());
print('Rename bands using a list (JavaScript array or ee.List)',
img.rename(['SWIR1', 'NIR', 'GREEN']).bandNames());
print('Rename bands using a series of string arguments',
img.rename('swir1', 'nir', 'green').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'
).select(['B11', 'B8', 'B3'])
display('Original selected S2 image band names:', img.bandNames())
display('Rename bands using a list (Python list or ee.List):',
img.rename(['SWIR1', 'NIR', 'GREEN']).bandNames())
display('Rename bands using a series of string arguments:',
img.rename('swir1', 'nir', 'green').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."],[],["The core functionality is to rename the bands of an image using the `Image.rename()` method. This method takes either a list or a series of string arguments as new band names. The number of new names provided must match the existing number of bands. The method returns the image with the updated band names. Examples demonstrate renaming bands of a Sentinel-2 image in both JavaScript and Python, using both a list and individual string arguments.\n"]]