ee.FeatureCollection.aggregate_stats

รวมคุณสมบัติที่กำหนดของออบเจ็กต์ในคอลเล็กชัน โดยคำนวณผลรวม ค่าต่ำสุด ค่าสูงสุด ค่าเฉลี่ย ค่าเบี่ยงเบนมาตรฐานของตัวอย่าง ความแปรปรวนของตัวอย่าง ค่าเบี่ยงเบนมาตรฐานทั้งหมด และความแปรปรวนทั้งหมดของพร็อพเพอร์ตี้ที่เลือก

การใช้งานการคืนสินค้า
FeatureCollection.aggregate_stats(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 capacities (MW) summary stats',
      fc.aggregate_stats('capacitymw'));

/**
 * Expected ee.Dictionary output
 *
 * {
 *   "max": 2910,
 *   "mean": 201.34242424242427,
 *   "min": 1.8,
 *   "sample_sd": 466.4808892319684,
 *   "sample_var": 217604.42001864797,
 *   "sum": 13288.600000000002,
 *   "sum_sq": 16819846.24,
 *   "total_count": 66,
 *   "total_sd": 462.9334545609107,
 *   "total_var": 214307.38335169878,
 *   "valid_count": 66,
 *   "weight_sum": 66,
 *   "weighted_sum": 13288.600000000002
 * }
 */

การตั้งค่า 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('Power plant capacities (MW) summary stats:')
pprint(fc.aggregate_stats('capacitymw').getInfo())

# Expected ee.Dictionary output

#  {
#   "max": 2910,
#    "mean": 201.34242424242427,
#    "min": 1.8,
#    "sample_sd": 466.4808892319684,
#    "sample_var": 217604.42001864797,
#    "sum": 13288.600000000002,
#    "sum_sq": 16819846.24,
#    "total_count": 66,
#    "total_sd": 462.9334545609107,
#    "total_var": 214307.38335169878,
#    "valid_count": 66,
#    "weight_sum": 66,
#    "weighted_sum": 13288.600000000002
#  }