ee.FeatureCollection.aggregate_array

对集合中对象的给定属性进行汇总,计算所选属性的所有值的列表。

用法返回
FeatureCollection.aggregate_array(property)列表
参数类型详细信息
此:collectionFeatureCollection要汇总的集合。
property字符串要从集合的每个元素中使用的属性。

示例

代码编辑器 (JavaScript)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
             .filter('country_lg == "Belgium"');

print('Power plant fuel sources',
      fc.aggregate_array('fuel1'));  // ee.List

Python 设置

如需了解 Python API 和如何使用 geemap 进行交互式开发,请参阅 Python 环境页面。

import ee
import geemap.core as geemap

Colab (Python)

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"')

print('Power plant fuel sources:',
      fc.aggregate_array('fuel1').getInfo())  # ee.List