Export an image clipped by features (Polygons). You can use the same arguments as the original function ee.batch.export.image.toDrive
Parameters
None
uses image's IDReturn a list of all tasks (for further processing/checking)
In [1]:
import ee
ee.Initialize()
from geetools import batch
In [2]:
p1 = ee.Geometry.Point([-71,-42])
p2 = ee.Geometry.Point([-71,-43])
p3 = ee.Geometry.Point([-71,-44])
In [3]:
feat1 = ee.Feature(p1.buffer(1000), {'site': 1})
feat2 = ee.Feature(p2.buffer(1000), {'site': 2})
feat3 = ee.Feature(p3.buffer(1000), {'site': 3})
In [4]:
fc = ee.FeatureCollection([feat1, feat2, feat3])
In [5]:
collection = ee.ImageCollection('COPERNICUS/S2').filterBounds(fc.geometry())
In [6]:
image = collection.mosaic()
In [10]:
task = batch.Export.image.toDriveByFeature(
image,
collection=fc,
folder='tools_exportbyfeat',
name='test {site}',
scale=10,
dataType='float',
verbose=True
)
In [ ]: