Skip to content

Instantly share code, notes, and snippets.

@VehpuS
Created December 7, 2022 13:25
Show Gist options
  • Save VehpuS/ecfd36ca3730353f20a7f092a5c03301 to your computer and use it in GitHub Desktop.
Save VehpuS/ecfd36ca3730353f20a7f092a5c03301 to your computer and use it in GitHub Desktop.
A small demonstration of Python client side loop over Google Earth Engine objects (instead of using .map which can only run server side code)
import ee
image_col = ee.ImageCollection(...) # This should work with FeatureCollections and other GEE iterables
img_list = image_col.toList(image_col.size())
for img_idx in range(0, image_col.size().getInfo()):
img = ee.Image(img_list.get(img_idx))
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment