leftfield-geospatial / geedim

Search, composite, and download Google Earth Engine imagery.

Home Page:https://geedim.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scale issue

giswqs opened this issue · comments

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)

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)