leftfield-geospatial / geedim

Search, composite, and download Google Earth Engine imagery.
https://geedim.readthedocs.io
Apache License 2.0
80 stars 11 forks source link

Scale issue #6

Closed giswqs closed 2 years ago

giswqs commented 2 years ago

The follow code will throw an error: EEException: Can't convert a computed geometry to GeoJSON. Use getInfo() instead. However, if the scale is changed to a value larger than 30 (e.g., 60), it works fine.

import geedim as gd
image = ee.Image('LANDSAT/LC09/C02/T1_L2/LC09_023031_20220617')
region = image.geometry()
image = image.multiply(0.0000275).add(-0.2).set(image.toDictionary())
img = gd.download.BaseImage(image)
img.download('landsat.tif', region=region, scale=30)
dugalh commented 2 years ago

Resolved with v1.5.1

BTW geedim supports automatic STAC scale and offset with the scale_offset parameter. So you could replace your snippet with:

from geedim.download import BaseImage
gd_image = BaseImage(ee.Image('LANDSAT/LC09/C02/T1_L2/LC09_023031_20220617'))
gd_image.download('landsat.tif', scale_offset=True)