ee.FeatureCollection.aggregate_mean

รวบรวมพร็อพเพอร์ตี้ที่กําหนดของออบเจ็กต์ในคอลเล็กชัน โดยคํานวณค่าเฉลี่ยของพร็อพเพอร์ตี้ที่เลือก

การใช้งานการคืนสินค้า
FeatureCollection.aggregate_mean(property)ตัวเลข
อาร์กิวเมนต์ประเภทรายละเอียด
ดังนี้ collectionFeatureCollectionคอลเล็กชันที่จะรวบรวมข้อมูล
propertyสตริงพร็อพเพอร์ตี้ที่จะใช้จากแต่ละองค์ประกอบของคอลเล็กชัน

ตัวอย่าง

โปรแกรมแก้ไขโค้ด (JavaScript)

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

print('Mean of power plant capacities (MW)',
      fc.aggregate_mean('capacitymw'));  // 201.342424242

การตั้งค่า 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('Mean of power plant capacities (MW):',
      fc.aggregate_mean('capacitymw').getInfo())  # 201.342424242