Image too large to export #775
-
Hi everyone, While using the geemap.ee_export_image() function, I received this error: Generating URL ... Is there simply a size ceiling? Any way I can work around this, apart from chopping up the image into smaller sections and exporting them individually? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
The limit is enforced by GEE, there is not much geemap can do. For large files, you have to export to Google Drive. See https://geemap.org/common/#geemap.common.ee_export_image_to_drive |
Beta Was this translation helpful? Give feedback.
-
It might help others that have the same problem, but you could chunk the region into smaller pieces and scale it according to your need. n = 6 # resulting into n-1^2 blocks
lons = np.linspace(lonmin, lonmax, n)
lats = np.linspace(latmin, latmax, n)
objs = []
counter = 1
for lonmin, lonmax in zip(lons[:-1], lons[1:]):
for latmin, latmax in zip(lats[:-1], lats[1:]):
region = ee.Geometry.BBox(lonmin, latmin, lonmax, latmax)
delayed = geemap.ee_export_image(image, filename=f"landsat{counter:05}.tif", scale=50, region=region)
counter += 1 I know that the region can be different from a simple boundary box, but what if we implement something like this? By the way, I tried to parallelize this with dask, it ran without errors but did not download anything. objs = []
counter = 1
for lonmin, lonmax in zip(lons[:-1], lons[1:]):
for latmin, latmax in zip(lats[:-1], lats[1:]):
region = ee.Geometry.BBox(lonmin, latmin, lonmax, latmax)
delayed = dask.delayed(geemap.ee_export_image)(image, filename=f"../data/external/landsat{counter:05}.tif", scale=50, region=region)
objs.append(delayed)
counter += 1
dask.compute(objs) |
Beta Was this translation helpful? Give feedback.
The limit is enforced by GEE, there is not much geemap can do. For large files, you have to export to Google Drive. See https://geemap.org/common/#geemap.common.ee_export_image_to_drive