I am learning Earth Engine with Python and I am stuck when I want to split the entire terraclimate
Image Collection with province feature collection.
admin = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2')
terraclimate = ee.ImageCollection('IDAHO_EPSCOR/TERRACLIMATE')
province_names = list(
np.unique(
np.array(
admin.filter(
ee.Filter.eq('ADM0_NAME', 'Indonesia')
).aggregate_array('ADM1_NAME').getInfo()
)
)
)
province_list = ee.List(province_names)
def get_province(province):
img_col = terraclimate.filterBounds(admin.filter(ee.Filter.eq('ADM1_NAME', province)))
return img_col.set({'province':province})
new_img_col = province_list.map(get_province)
What I get from the code above is a list of ImageCollection. How can I convert this into a single ImageCollection? I try to unpack the list with another map but it gave me error:
'ComputedObject' object has no attribute 'map'
What I'm trying to achieve with this is to get an image collection where each image is separated by province, and afterward, I will use it to calculate mean yearly temperature for each province.