Google Earth Engine(GEE)——过滤filter影像集合
Earth Engine 提供了多种方便的方法来过滤图像集合。具体来说,许多常见用例由imageCollection.filterDate()
、 和处理imageCollection.filterBounds()
。对于一般目的的过滤,使用 imageCollection.filter()
具有ee.Filter
作为参数。以下示例演示了两种便捷方法以及filter()
从 中识别和删除配准不良的图像ImageCollection
:
filterMetadata(name, operator, value)
按元数据过滤集合的快捷方式。这相当于 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, percentile, cloudScoreRange, maxDepth, asFloat)
从原始 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.
用于计算每个像素的最大场景数的近似限制。
asFloat (Boolean, default: false):
如果为真,则输出波段与 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
这是显示效果不好的影像
这个现实效果较好,这里重点说的是除了云之后的影像完整性!
代码:
// 加载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');
相关文章
- Google Earth Engine(GEE)——过滤矢量集合FeatureCollection并进行属性的设定
- Google Earth Engine(GEE)—geemap映射到图像集合(map)
- Google Earth Engine(GEE)—geemap Image collection影像集合筛选和属性信息获取
- Google Earth Engine(GEE)——fliter()筛选矢量集合的有用信息
- Google Earth Engine(GEE)——JavaScript基本功能介绍( 矢量集合FeatureCollections)
- Google Earth Engine(GEE)——landsat 8 和9影像集合SR_B6无法进行映射
- Google Earth Engine(GEE)——swissSURFACE3D光栅(DSM)数据集
- Google Earth Engine ——Landsat 7 影像集合数据集详细介绍
- Google Earth Engine——流域边界数据集 (WBD) 是水文单位 (HU) 数据的综合汇总集合,与国家划定和分辨率标准一致。它定义了地表水排放到某个点的区域范围
- Google Earth Engine ——MACAv2-METDATA 月度数据集涵盖美国本土的 20 个全球气候模型(GCM) 的集合1900-2099年
- Google Earth Engine(GEE)——特征和特征集合图表概述和柱状图
- Google Earth Engine(GEE)——影像集合的按照行列号搜索并且统计影像数量包括时间、云量和最新影像筛选!
- Google Earth Engine(GEE)——创建不同等级道路一个特征集合
- [Google Guava] 2.1-不可变集合