前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Google Earth Engine(GEE)——过滤filter影像集合

Google Earth Engine(GEE)——过滤filter影像集合

作者头像
此星光明
发布2024-02-01 20:07:28
1070
发布2024-02-01 20:07:28
举报

Earth Engine 提供了多种方便的方法来过滤图像集合。具体来说,许多常见用例由imageCollection.filterDate()、 和处理imageCollection.filterBounds()。对于一般目的的过滤,使用 imageCollection.filter()具有ee.Filter作为参数。以下示例演示了两种便捷方法以及filter() 从 中识别和删除配准不良的图像ImageCollection

filterMetadata(name, operator, value)

代码语言:javascript
复制
按元数据过滤集合的快捷方式。这相当于 this.filter(ee.Filter.metadata(...))。当然这两个可以根据自己喜好来随意切换。

Shortcuts to filter a collection by metadata. This is equivalent to this.filter(ee.Filter.metadata(...)).

Returns the filtered collection.

Arguments:

this:collection (Collection):

The Collection instance.

name (String):这里一般是你要过滤的影像波段名称

The name of a property to filter.

operator (String):这里是进行顾虑的条件

The name of a comparison operator. Possible values are: "equals", "less_than", "greater_than",

"not_equals", "not_less_than", "not_greater_than", "starts_with",

"ends_with", "not_starts_with", "not_ends_with", "contains",

"not_contains".

value (Object):

- The value to compare against.

Returns: Collection

ee.Algorithms.Landsat.simpleComposite(collection, percentilecloudScoreRangemaxDepthasFloat)

代码语言:javascript
复制
从原始 Landsat 场景集合中计算 Landsat TOA 合成。它应用标准 TOA 校准,然后使用 SimpleLandsatCloudScore 算法为每个像素分配一个云分数。它在每个点选择尽可能低的云分数范围,然后根据接受的像素计算每个波段的百分位值。该算法还使用 LandsatPathRowLimit 算法在超过 maxDepth 输入场景可用的区域中仅选择最少云的场景。说白了就是一个简单的除云函数。

Computes a Landsat TOA composite from a collection of raw Landsat scenes. It applies standard TOA calibration and then assigns a cloud score to each pixel using the SimpleLandsatCloudScore algorithm. It selects the lowest possible range of cloud scores at each point and then computes per-band percentile values from the accepted pixels. This algorithm also uses the LandsatPathRowLimit algorithm to select only the least-cloudy scenes in regions where more than maxDepth input scenes are available.

Arguments:

collection (ImageCollection):影像集合

The raw Landsat ImageCollection to composite.

percentile (Integer, default: 50):百分比

The percentile value to use when compositing each band.

cloudScoreRange (Integer, default: 10):可以接受的云质量的影像范围

The size of the range of cloud scores to accept per pixel.

maxDepth (Integer, default: 40):

An approximate limit on the maximum number of scenes used to compute each pixel.

代码语言:javascript
复制
用于计算每个像素的最大场景数的近似限制。

asFloat (Boolean, default: false):

代码语言:javascript
复制
如果为真,则输出波段与 Landsat.TOA 算法的单位相同;如果为 false,TOA 值将通过乘以 255(反射带)或减去 100(热带)并四舍五入到最接近的整数来转换为 uint8。这里默认false我也不知道为什么,一般不影响结果就好。

If true, output bands are in the same units as the Landsat.TOA algorithm; if false, TOA values are converted to uint8 by multiplying by 255 (reflective bands) or subtracting 100 (thermal bands) and rounding to the nearest integer.

Returns: Image

这是显示效果不好的影像

 这个现实效果较好,这里重点说的是除了云之后的影像完整性! 

代码:

代码语言:javascript
复制
// 加载Landsat5影像,然后按照时间进行筛选并且以点为数据进行筛选
var collection = ee.ImageCollection('LANDSAT/LT05/C01/T2')
  .filterDate('1987-01-01', '1990-05-01')
  .filterBounds(ee.Geometry.Point(25.8544, -18.08874));

// 同样可以进行影像质量的筛选,一会会介绍关于filterMetadata函数
var filtered = collection
  .filterMetadata('IMAGE_QUALITY', 'equals', 9);

// 创建两个简单合成以检查按上面进行过筛选过后的 IMAGE_QUALITY 过滤的效果。
var badComposite = ee.Algorithms.Landsat.simpleComposite(collection, 75, 3);
var goodComposite = ee.Algorithms.Landsat.simpleComposite(filtered, 75, 3);

// 加载展示的中心经纬度和缩放打下,最后展示两幅影像
//效果明显是经过质量筛选后的效果好
Map.setCenter(25.8544, -18.08874, 13);
Map.addLayer(badComposite,
             {bands: ['B3', 'B2', 'B1'], gain: 3.5},
             'bad composite');
Map.addLayer(goodComposite,
             {bands: ['B3', 'B2', 'B1'], gain: 3.5},
             'good composite');
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2024-02-01,如有侵权请联系 cloudcommunity@tencent.com 删除

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

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

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

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Arguments:
  • Returns: Collection
  • Arguments:
  • Returns: Image
相关产品与服务
云函数
云函数(Serverless Cloud Function,SCF)是腾讯云为企业和开发者们提供的无服务器执行环境,帮助您在无需购买和管理服务器的情况下运行代码。您只需使用平台支持的语言编写核心代码并设置代码运行的条件,即可在腾讯云基础设施上弹性、安全地运行代码。云函数是实时文件处理和数据处理等场景下理想的计算平台。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档