VeinsOfTheEarth / rabpro

Delineating watershed basins and computing attribute statistics using Google Earth Engine
https://VeinsOfTheEarth.github.io/rabpro
BSD 3-Clause "New" or "Revised" License
35 stars 8 forks source link

basins_stats.compute fails with basins_gdf argument #147

Closed jsta closed 1 year ago

jsta commented 1 year ago

Even with a tiny polygon object, the earthengine API says:

ee.ee_exception.EEException: Object too large (4000000016 bytes).

You can pass an asset path with the gee_feature_path argument to get around this error.

jonschwenk commented 1 year ago

This could have happened because I was maxxing out rabpro's GEE memory with other runs. Those have been cancelled so maybe try again? Or if you were using your personal GEE account then it's a real bug.

jsta commented 1 year ago

I was using my personal account.

jsta commented 1 year ago

Works:

Doesn't work:

# works
urls, tasks = rabpro.basin_stats.compute(
        [Dataset("projects/soilgrids-isric/soc_mean", "soc_0-5cm_mean", stats=statlist, gee_type="image")], 
    basins_gdf=gdf, validate_dataset_list=False)

# doesn't work, doesn't matter what the resolution is set at
urls, tasks = rabpro.basin_stats.compute(
        [Dataset("JRC/GSW1_3/GlobalSurfaceWater", "occurrence", stats=statlist, gee_type="image")], 
    basins_gdf=gdf, validate_dataset_list=False)

Proposed fix:

Arbitrarily subject image assets to a time reducer which should have no effect other than avoiding the above error