ee.FeatureCollection.aggregate_histogram

コレクション内のオブジェクトの指定されたプロパティを集計し、選択したプロパティのヒストグラムを計算します。

用途戻り値
FeatureCollection.aggregate_histogram(property)Dictionary
引数タイプ詳細
これ: collectionFeatureCollection集計するコレクション。
property文字列コレクションの各要素から使用するプロパティ。

コードエディタ(JavaScript)

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

print('Histogram of power plant capacities (MW)',
      fc.aggregate_histogram('capacitymw'));  // Dictionary

Python の設定

Python API とインタラクティブな開発での geemap の使用については、 Python 環境のページをご覧ください。

import ee
import geemap.core as geemap

Colab(Python)

from pprint import pprint

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

print('Histogram of power plant capacities (MW):')
pprint(fc.aggregate_histogram('capacitymw').getInfo())  # Dictionary