In the below code I'm going to get image id in a function but returns error. Could anyone guide me please? How can I solve this?
code link: https://code.earthengine.google.com/154cea3df7a29cdf0a42b13f3a71f42c
Map.centerObject(table);
Map.addLayer(table);
var uhi = ee.ImageCollection("YALE/YCEO/UHI/Summer_UHI_yearly_pixel/v4")
.filterBounds(table)
.mean().clip(table)
print(uhi)
// normalization process
var normal = function(img){
var id = ee.String(img.get('system:id'))
var min = ee.Number(img.reduceRegion(ee.Reducer.min(), table, 1000).get(id));
var max = ee.Number(img.reduceRegion(ee.Reducer.max(), table, 1000).get(id));
var normalization = (img.subtract(min)).divide(max.subtract(min));
return normalization;
};
var uhiNormal = normal(uhi.select('Daytime'));
print(uhiNormal);
mean()
at the beginning of the code, you lost the ID, because you are converting the collection into a single image (a mean composite). This composite does not have an id unless you set it.