Sentinel-2 以条带方式拍摄地球图像,这些条带根据军事网格参考系统或“MGRS”切片方案划分为瓷砖分布。对于您所在的地区,有两个具有广泛重叠的磁贴(36TYM、37TBG)。您可以在此处探索网格系统。它们是来自相同条带的数据,但对于 SR 产品,两者对于“相同像素”的值可能略有不同,因为 SR 数据是在分块级别处理的,并且两个不同 UTM 区域(36TYM)的重采样存在差异是 EPSG:32636 而 37TBG 是 EPSG:32637) 并且大气校正等参数的差异会传播到结果。
为避免“重复”数据,您可以通过要保留的 MGRS_TILE 属性值列表过滤集合,例如仅保留 36TYM 和 36TYN 磁贴数据:
函数:
ee.Filter.inList(leftField, rightValue, rightField, leftValue)
Filter on metadata contained in a list.
Returns the constructed filter.
Arguments:
leftField (String, optional):
A selector for the left operand. Should not be specified if leftValue is specified.
rightValue (List<Object>|Object, optional):
The value of the right operand. Should not be specified if rightField is specified.
rightField (String, optional):
A selector for the right operand. Should not be specified if rightValue is specified.
leftValue (List<Object>|Object, optional):
The value of the left operand. Should not be specified if leftField is specified.
Returns: Filter
var tileList = ['36TYM', '36TYN'] var SrFiltered = Sr.filter(ee.Filter.inList('MGRS_TILE', tileList))
代码:
var geometry=ee.Geometry.Polygon([[35.602367261137886,41.62480227265362], [36.563670972075386,41.62480227265362], [36.563670972075386,42.54611702000942], [35.602367261137886,42.54611702000942], [35.602367261137886,41.62480227265362]]) Map.centerObject(geometry) var Sr = ee.ImageCollection('COPERNICUS/S2_SR') .filterBounds(geometry) .filter(ee.Filter.lte('CLOUDY_PIXEL_PERCENTAGE', 5)) .filterDate('2021-01-01','2021-12-30') print('Sr size', Sr.size()) print('Sr sample', Sr.limit(20)) var list=Sr.toList(20) Map.addLayer(ee.Image(list.get(0)),{'bands':['B4','B3','B2'], 'min':0, 'max':2000}) Map.addLayer(ee.Image(list.get(1)),{'bands':['B4','B3','B2'], 'min':0, 'max':2000}) var tileList = ['36TYM', '36TYN'] var SrFiltered = Sr.filter(ee.Filter.inList('MGRS_TILE', tileList)) print('SrFiltered size', SrFiltered.size()) print('SrFiltered sample', SrFiltered.limit(20))