fromList#
- classmethod geetools.ImageAccessor.fromList(images)#
Create a single image by passing a list of images.
Warning: The bands cannot have repeated names, if so, it will throw an error (see examples).
- Parameters:
- Returns:
A single ee.Image with one band per image in the passed list
Examples
import ee, geetools ee.Initialize() sequence = ee.List([1, 2, 3]) images = sequence.map(lambda i: ee.Image(ee.Number(i)).rename(ee.Number(i).int().format())) image = ee.Image.geetools.fromList(images) print(image.bandNames().getInfo())
import ee, geetools ee.Initialize() sequence = ee.List([1, 2, 2, 3]) images = sequence.map(lambda i: ee.Image(ee.Number(i)).rename(ee.Number(i).int().format())) image = ee.Image.geetools.fromList(images) print(image.bandNames().getInfo())
> ee.ee_exception.EEException: Image.rename: Can’t add a band named ‘2’ to image because a band with this name already exists. Existing bands: [1, 2].