Timeline for Exporting GEE satellite imagery to Numpy array
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 15, 2021 at 6:07 | comment | added | Nicolas Suarez |
I actually figured out how to do this in the end (I'm going to answer the question now), but I'm not aware of a good way to avoid the .tif format. In my final approach I used ee.batch.Export.image.toDrive (ee.batch.Export.image.toCloudStorage works in a very similar way) because it generates only one TIFF file with all the channels of the image rather than a ZIP file with one file for each channel. After downloading the file, I used the imageio package, and did something like np.array(imageio.imread(image_path)) to convert the image from TIFF to an np.array .
|
|
Jun 15, 2021 at 2:22 | comment | added | Rob Marty |
Just checking to confirm that there's not a way to go straight to the np.array (eg, avoiding exporting as a .tif then importing back in?) I'm able to get a list, but would be great to just get the np.appy img_list =ee.ImageCollection("LANDSAT/LC08/C01/T1").filterDate('2020-01-01', '2020-12-31').select(['B3','B4','B2']).mean().reduceRegion(reducer=ee.Reducer.toList(),geometry=patch,scale=30) print(img_list.getInfo())
|
|
Jan 25, 2021 at 7:33 | history | edited | Kadir Şahbaz | CC BY-SA 4.0 |
added 49 characters in body
|
Jan 25, 2021 at 3:23 | comment | added | Nicolas Suarez |
Thanks Nuno! My problems were mainly how to take the mean of the ImageCollection and how to properly intersect my Geometry with my image, but I can use what you mentioned to later export the images properly to my desired format.
|
|
Jan 25, 2021 at 3:07 | history | answered | Nuno César de Sá | CC BY-SA 4.0 |