Closed svHatch closed 2 years ago
This is a limit enforced by Earth Engine. There is nothing geemap can do about it. You can either simplify the shapes, reducing the number of vertices to make the file smaller, or you need to upload the file using the GEE Code Editor.
@giswqs - understood. However, the error message is misleading. My shapefile is 5 Mb, and the listed payload size limit is 9 Mb.
What are the extra bytes that are part of the request that are making it unable to upload?
geemap could get total size info after converting to geoJSON, then assess whether it would trigger a size limit, and then provide a more helpful error message: "Earth Engine limits API requests to {this size}. Your local file is {this size}. In order to use this local file you must upload it through {this site} and then reference it from geemap."
Something along those lines.
The error message is from the earth engine API, not from geemap. From my experience, any file larger than 4.5 MB will likely fail to upload. Keep in mind that under the hood, the shapefile is being converted to GeoJSON, then to ee.FeatureCollection. The GeoJSON can be much larger than the original shapefile. A GeoJSON smaller than 10485760 bytes does not guarantee that it will be uploaded successfully. There could be other issues causing the upload to fail, e.g., encoding error.
If you have a better solution for handling the error, please feel free to submit a pull request.
Environment Information
Description
Trying to convert a local shapefile (5 Mb) into a GEE Geometry.
I got an error: "EEException: Request payload size exceeds the limit: 10485760 bytes." Which equates to 9.5367 Mb.
What I Did