clipOnCollection#

geetools.ImageAccessor.clipOnCollection(fc, keepProperties=1)#

Clip an image to a ee.FeatureCollection.

The image will be clipped to every single features of the featureCollection as one independent image.

Parameters:
Returns:

The clipped ee.ImageCollection.

Return type:

ee.ImageCollection

Examples

import ee, geetools

ee.Initialize()

src = 'COPERNICUS/S2_SR_HARMONIZED/20200101T100319_20200101T100321_T32TQM'
image = ee.Image(src)
fc = ee.FeatureCollection('FAO/GAUL/2015/level0')
clipped = image.geetools.clipOnCollection(fc)
print(clipped.size().getInfo())