Given a FeatureCollection that contains multiple Features (each consisting of polygons), I would like to use the Python API to loop through them all, and batch export them to Google Cloud Storage.
However, I can't figure out how to make all the code server-side, and hence my code runs extremely slowly (using the major no-no of getInfo inside a loop).
for i in range(0, 1000):
region = ee.Feature(myFeatCol.get(i)).geometry()
task = ee.batch.Export.image.toCloudStorage(
image = naip.clip(region),
description = 'uniqueName'+str(i),
fileNamePrefix = 'uniqueName'+str(i),
bucket = 'myGoogleBucketName',
scale = 1,
region = region.getInfo()['coordinates'])
task.start()
The objective here is to end up with 1000 images in the bucket. It works, but is painstakingly slow! Several-minutes-per-image slow.
How can I create an efficient server-side loop to export an entire FeatureCollection?