-
Hi, I am recently using geemap on google colab and this is fantastic! import ee
import geemap
import geopandas as gpd
import pandas as pd
import os
dist = ee.FeatureCollection('users/geografo2023/distritos_inei_2017')
start_date = '2000-01-01'
end_date = '2023-12-31'
chirps = ee.ImageCollection("UCSB-CHG/CHIRPS/DAILY")\
.select('precipitation')\
.filterDate(start_date,end_date)\
.toBands()
out_dir = os.path.join(os.path.expanduser("~"), "/content/descargas")
out_chrips_stats = os.path.join(out_dir, "chirps_stats.csv")
geemap.zonal_stats(chirps, dist, out_chrips_stats, stat_type="MEAN", scale=5566) Computing statistics ...
---------------------------------------------------------------------------
HttpError Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/ee/data.py](https://localhost:8080/#) in _execute_cloud_call(call, num_retries)
401 try:
--> 402 return call.execute(num_retries=num_retries)
403 except googleapiclient.errors.HttpError as e:
8 frames
HttpError: <HttpError 400 when requesting https://earthengine.googleapis.com/v1/projects/ee-geografope/value:compute?prettyPrint=false&alt=json returned "ImageCollection.toBands: Too many bands (more than 5000).". Details: "ImageCollection.toBands: Too many bands (more than 5000).">
During handling of the above exception, another exception occurred:
EEException Traceback (most recent call last)
EEException: ImageCollection.toBands: Too many bands (more than 5000).
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/geemap/common.py](https://localhost:8080/#) in zonal_stats(in_value_raster, in_zone_vector, out_file_path, stat_type, scale, crs, tile_scale, return_fc, verbose, timeout, proxies, **kwargs)
7039 ee_export_vector(result, filename, timeout=timeout, proxies=proxies)
7040 except Exception as e:
-> 7041 raise Exception(e)
7042
7043
Exception: ImageCollection.toBands: Too many bands (more than 5000). |
Beta Was this translation helpful? Give feedback.
Answered by
giswqs
May 28, 2024
Replies: 1 comment 2 replies
-
I reduce the range but I have a similar error start_date = '2000-01-01'
end_date = '2010-12-31'
chirps = ee.ImageCollection("UCSB-CHG/CHIRPS/DAILY")\
.select('precipitation')\
.filterDate(start_date,end_date)\
.toBands() Computing statistics ...
---------------------------------------------------------------------------
HttpError Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/ee/data.py](https://localhost:8080/#) in _execute_cloud_call(call, num_retries)
401 try:
--> 402 return call.execute(num_retries=num_retries)
403 except googleapiclient.errors.HttpError as e:
8 frames
HttpError: <HttpError 400 when requesting https://earthengine.googleapis.com/v1/projects/ee-geografope/value:compute?prettyPrint=false&alt=json returned "Computed value is too large.". Details: "Computed value is too large.">
During handling of the above exception, another exception occurred:
EEException Traceback (most recent call last)
EEException: Computed value is too large.
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/geemap/common.py](https://localhost:8080/#) in zonal_stats(in_value_raster, in_zone_vector, out_file_path, stat_type, scale, crs, tile_scale, return_fc, verbose, timeout, proxies, **kwargs)
7039 ee_export_vector(result, filename, timeout=timeout, proxies=proxies)
7040 except Exception as e:
-> 7041 raise Exception(e)
7042
7043
Exception: Computed value is too large. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The limit is enforced by Earth Engine, not by geemap. It doesn't matter if you are using JS or Python. The solution is to use a collection with fewer images