GEE之FeatureCollection入门操作1

这篇博客介绍了Google Earth Engine(GEE)中FeatureCollection的FilterMetadata方法,用于根据特征集合的元数据进行筛选。内容包括如何通过指定属性名、比较运算符和目标值来过滤FeatureCollection,并展示了如何利用此方法结合filterBounds()缩小处理区域,以便于处理大区域数据。此外,还提及了这种方法在处理内存限制问题时的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

FeatureCollection

GEE之FeatureCollection入门操作1



FeatureCollection 区域选择,点选。


FilterMetadata

官方函数:

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

用法

输入参数有3个,第一个是选择的属性名字,第二个是判断符号(等于,小于等),第三个是目标值。 比如

filterMetadata('flag','equals','false')
//option
"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".

就是选择 flag等于false的feature


如果点集FeatureCollection ,还可以用filterBounds() 去选择区域;跟ImageCollection 同理。

如果有一个点集和矢量集合,而直接在GEE中运行会内存不足,则可以通过filterMetadata选择矢量集合中单个feature,从而可以进行循环;然后求geometry属性,选择Bounds区域 ,从点集合中选择出对应feature中的点集。

var eft = table.filterMetadata('flag','equals',4);
var roi = eft.geometry();
var cepo = table2.filterBounds(roi);

这样就可以大区域变小区域,进行循环,提取数值等。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值