以下代码可以在一张图像的区域中绘制直方图(假设“几何形状”已预定义),但是如何获得整个ImageCollection的聚合直方图?
//load imageCollection
var startDate = '2007-03-01';
var endDate = '2008-01-01'
var MOD09A1 = ee.ImageCollection('MODIS/006/MOD09A1')
.select(0,1,2,3,4,5,6)
.filterDate(startDate, endDate);
//draw chart
var histogram = ui.Chart.image.histogram({
image: MOD09A1.first(),
region: geometry,
scale: 10000,
minBucketWidth: 100,
});
histogram.setOptions({
title: 'Histogram of MOD09A1'
});
print(histogram);