ee.Image.rename

Renommez les bandes d'une image.

Renvoie l'image renommée.

UtilisationRenvoie
Image.rename(var_args)Image
ArgumentTypeDétails
ceci : imageImageInstance Image.
var_argsList<String>|Object|VarArgs<String>Nouveaux noms des groupes. Doit correspondre au nombre de bandes dans l'image.

Exemples

Éditeur de code (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());

Configuration de Python

Consultez la page Environnement Python pour en savoir plus sur l'API Python et sur l'utilisation de geemap pour le développement interactif.

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'])
print('Original selected S2 image band names:', img.bandNames().getInfo())

print('Rename bands using a list (Python list or ee.List):',
      img.rename(['SWIR1', 'NIR', 'GREEN']).bandNames().getInfo())

print('Rename bands using a series of string arguments:',
      img.rename('swir1', 'nir', 'green').bandNames().getInfo())