As the function documentation suggests, we know that the reduceRegion() function comes in handy when we get the 'Too many pixels' error due to server restrictions. I'm currently working on Google Colab and my code is the following:
image = ee.Image('LANDSAT/LE7_TOA_5YEAR/2008_2012')
aoi = getPolygon((55.2708, 25.2048), 0.15)
# Reduce the region. The region parameter is the Feature geometry.
meanDictionary = image.reduceRegion(reducer=ee.Reducer.mean(), geometry=aoi, scale=90, maxPixels=262144)
The result I naturally get after printing meanDictionary.getInfo()
is a dictionary of different band values:
{'B1': 48.80214808618162,
'B2': 50.636738705868815,
'B3': 53.1672805851419,
'B4': 58.36716764069926,
'B5': 56.440968073087255,
'B6_VCID_2': 209.51128253916946,
'B7': 43.215088529918695}
My question is how do I get the actual reduced Image as a ee.image.Image
object after reduceRegion() has been called with its respective parameters, since it only returns a dictionary. I could be off-track, if so, some guidance in the right direction would help please!