Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk Export ImageCollection not working #261

Open
noejn2 opened this issue Apr 5, 2024 · 1 comment
Open

Bulk Export ImageCollection not working #261

noejn2 opened this issue Apr 5, 2024 · 1 comment

Comments

@noejn2
Copy link

noejn2 commented Apr 5, 2024

I am running the script gee/exporting_images_from_gee/export_image_collection.ipynb and getting the following error, which I don't seem to understand. I get the attributes as specify there, and despite that it tells me such attribute is there, I can't make this code work.

`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[170], line 27
22 collection = (ee.ImageCollection('COPERNICUS/S2_SR')
23 .filterDate('2022-01-01', '2022-03-01')
24 .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 5))
25 .filterBounds(roi))
26 # Export the ImageCollection
---> 27 tasks = geetools.batch.Export.imagecollection.toDrive(
28 collection=collection,
29 folder='gee_images',
30 region=roi.getInfo()['coordinates'],
31 namePattern='{id}',
32 scale=300,
33 dataType='uint32',
34 verbose=True,
35 maxPixels=int(1e13)
36 )

File /usr/local/anaconda3/envs/ee-work/lib/python3.10/site-packages/geetools/batch/imagecollection.py:61, in toDrive(collection, folder, namePattern, scale, dataType, region, datePattern, extra, verbose, **kwargs)
59 # get region
60 if region:
---> 61 region = tools.geometry.getRegion(region)
63 # Make a list of images
64 img_list = collection.toList(collection.size())

File /usr/local/anaconda3/envs/ee-work/lib/python3.10/site-packages/deprecated/classic.py:285, in deprecated..wrapper_function(wrapped_, instance_, args_, kwargs_)
283 else:
284 warnings.warn(msg, category=category, stacklevel=routine_stacklevel)
--> 285 return wrapped(*args_, **kwargs_)

File /usr/local/anaconda3/envs/ee-work/lib/python3.10/site-packages/geetools/tools/_deprecated_geometry.py:14, in getRegion(eeobject, bounds, error)
11 @deprecated(version="1.0.0", reason="Use ee.ComputedObject.geometry() instead")
12 def getRegion(eeobject, bounds=False, error=1):
13 """Gets the region of a given geometry to use in exporting tasks."""
---> 14 return eeobject.geometry()

AttributeError: 'list' object has no attribute 'geometry'`

@12rambau
Copy link
Member

12rambau commented Apr 7, 2024

This script is not compatible with version 1.0 of the lib as exportation has not been refactored yet. Could you try using 0.6.14 ?
Alternatively can you look at my answer in #256 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants