2

I am trying to extract the data for the particular country using the shapefile for the province to get the daily precipitation data. But whenever I run the following code error displays:

ImageCollection (Error) Collection.geometry: Geometry has too many edges (2171869 > 2000000)

// Loading the data

var dataset = ee.ImageCollection("ECMWF/ERA5/MONTHLY")
              .filter(ee.Filter.calendarRange(1986,1987,'year'))
              .filter(ee.Filter.calendarRange(1,1,'month'))
              .filterBounds(table2); // Here table2 is the shapefile for the country's province.
              
var total_precipitation = dataset.select('total_precipitation');

print('total precipitation in Image Collection',total_precipitation);

But I can't change my boundary points as they are the predefined province of the country. I am stuck and unable to move ahead.

1
  • Can you provide a reproducible example?
    – Yas
    Commented May 16, 2022 at 21:08

1 Answer 1

1

I think this is a Google Earth Engine limitation that can be workaround by simplifying the geometry - the following function will remove non-significant edges:

https://developers.google.com/earth-engine/apidocs/ee-geometry-simplify

example:

var table2_simplified = table2.simplify({'maxError': 1})
var dataset = ee.ImageCollection("ECMWF/ERA5/MONTHLY")
              .filter(ee.Filter.calendarRange(1986,1987,'year'))
              .filter(ee.Filter.calendarRange(1,1,'month'))
              .filterBounds(table2_simplified); // Here table2 is the shapefile for the country's province.
              
var total_precipitation = dataset.select('total_precipitation');

print('total precipitation in Image Collection',total_precipitation);

maxError can be estimated experimentally to get a trade-off between the number of edges and the loss of data.

After use, verify that the data loss is not too significant.

1
  • Thanks for the help. It helped me to solve the geometry problem. Commented Jun 1, 2022 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.