geetools.ImageAccessor.format#

geetools.ImageAccessor.format(string, dateFormat='yyyy-MM-dd')#

Create a string from using the given pattern and using the image properties.

The system_date property is special cased to fit the dateFormat parameter.

Parameters:
  • string (geetools.types.ee_str) – The pattern to use for the string

  • dateFormat (geetools.types.ee_str) – The date format to use for the system_date property

Returns:

The string corresponding to the image

Return type:

ee.String

Examples

import ee, geetools

ee.Initialize()

image = ee.Image('COPERNICUS/S2_SR_HARMONIZED/20200101T100319_20200101T100321_T32TQM')
string = image.geetools.format('this is the image date: {system_date}')
print(string.getInfo())