geetools.Image.ImageAccessor.addPrefix#

geetools.Image.ImageAccessor.addPrefix(prefix, bands=[])#

Add a prefix to the image selected band.

Add a prefix to the selected band. If no band is specified, the prefix is added to all bands.

Parameters:
  • prefix (geetools.types.ee_str) – The prefix to add to the band.

  • bands (geetools.types.ee_list) – The bands to add the prefix to. If None, all bands are selected.

Returns:

The image with the prefix added to the selected bands.

Examples

import ee, geetools

ee.Initialize()

image = ee.Image('COPERNICUS/S2_SR_HARMONIZED/20200101T100319_20200101T100321_T32TQM')
image = image.geetools.addPrefix('prefix_')
print(image.bandNames().getInfo())