很多时候我们需要计算损失量,比如说河流或者森林,这样我们可以分析其逐年损失的森林面积,具体就是我们需要掩膜空值的区域,然后计算其面积,使用reduce region进行分析。最后我们在制作图表的时候,首先要先建立时间和面积,然后将其集合封装成为一个影像集合,然后分别转化为列表,然后建立一个字典,通过字典的形式将其转化为图表的形式。我们首先要看函数:
reduceRegion(reducer, geometry, scale, crs, crsTransform, bestEffort, maxPixels, tileScale)
Apply a reducer to all the pixels in a specific region.
Either the reducer must have the same number of inputs as the input image has bands, or it must have a single input and will be repeated for each band.
Returns a dictionary of the reducer's outputs.
Arguments:
this:image (Imag