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
import sys
sys.path.append("../..")
ee.Initialize()
from geetools import batch
In [2]:
p1 = ee.Geometry.Point([-71,-42])
feat1 = ee.Feature(p1.buffer(1000), {'site': 1})
fc = ee.FeatureCollection([feat1])
collection = ee.ImageCollection('COPERNICUS/S2').filterBounds(fc.geometry()).filterDate("2015-01-01","2015-12-01")
In [3]:
# please ensure that you have a default project enabled
# and change this bucket with a bucket you have write access
BUCKET = "opencrops"
batch.imagecollection.toCloudStorage(collection, bucket=BUCKET, folder="geetools", scale=30, verbose=True)
In [4]:
# check the storage bucket via the gsutil tool
!gsutil ls gs://opencrops/geetools