本文内容仅对sentinel-2A数据进行简单的数量查询,若要查询其他数据可在代码中更改数据来源。
//加载指定的shp范围
var geometry = ee.FeatureCollection("xxx")
//在地图中显示
Map.addLayer(geometry)
var collection = ee.ImageCollection('COPERNICUS/S2') //添加哨兵数据源
.filterBounds(geometry)
.filterDate('2021-07-01', '2021-08-01') //查询时间范围
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 10)) //云量范围
//查询数量
print('collection:',collection);
var count =collection.size();
print('count:',count);
//将影像覆盖情况添加至地图
Map.addLayer(collection)
查询的数量会在console中显示
在添加Map.addLayer后可将查询到的影像加载至地图中,用于得到时间范围内影像的覆盖情况
eg:济南('2021-07-01', '2021-08-01') 云量10