前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Google Earth Engine(GEE)——Sentinel-2影像在同一区域同一时间段有多个不同的ID影像,如何进行筛选其中单景影像

Google Earth Engine(GEE)——Sentinel-2影像在同一区域同一时间段有多个不同的ID影像,如何进行筛选其中单景影像

作者头像
此星光明
发布2024-02-02 13:56:34
1590
发布2024-02-02 13:56:34
举报

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
代码语言:javascript
复制
var tileList = ['36TYM', '36TYN']
var SrFiltered = Sr.filter(ee.Filter.inList('MGRS_TILE', tileList))

代码:

代码语言:javascript
复制
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))
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2024-02-01,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Arguments:
  • Returns: Filter
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档