ประกาศ: โปรเจ็กต์ที่ไม่ใช่เชิงพาณิชย์ทั้งหมดที่ลงทะเบียนเพื่อใช้ Earth Engine ก่อนวันที่ 
15 เมษายน 2025 ต้อง
ยืนยันการมีสิทธิ์ที่ไม่ใช่เชิงพาณิชย์เพื่อรักษาสิทธิ์เข้าถึง หากคุณไม่ยืนยันภายในวันที่ 26 กันยายน 2025 ระบบอาจระงับสิทธิ์เข้าถึงของคุณ
  
        
 
       
     
  
  
  
    
  
  
  
    
      ee.ImageCollection.aggregate_histogram
    
    
      
    
    
      
      จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
    
    
      
      บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
    
  
  
รวบรวมคุณสมบัติที่กำหนดของออบเจ็กต์ในคอลเล็กชัน โดยคำนวณฮิสโทแกรมของพร็อพเพอร์ตี้ที่เลือก
| การใช้งาน | การคืนสินค้า | 
|---|
| ImageCollection.aggregate_histogram(property) | พจนานุกรม | 
| อาร์กิวเมนต์ | ประเภท | รายละเอียด | 
|---|
| ดังนี้ collection | FeatureCollection | คอลเล็กชันที่จะรวบรวมข้อมูล | 
| property | สตริง | พร็อพเพอร์ตี้ที่จะใช้จากแต่ละองค์ประกอบของคอลเล็กชัน | 
  
  
  ตัวอย่าง
  
    
  
  
    
    
  
  
  
  
    
    
    
      โปรแกรมแก้ไขโค้ด (JavaScript)
    
    
  // A Lansat 8 TOA image collection for a specific year and location.
var col = ee.ImageCollection("LANDSAT/LC08/C02/T1_TOA")
  .filterBounds(ee.Geometry.Point([-122.073, 37.188]))
  .filterDate('2018', '2019');
// An image property of interest, percent cloud cover in this case.
var prop = 'CLOUD_COVER';
// Use ee.ImageCollection.aggregate_* functions to fetch information about
// values of a selected property across all images in the collection. For
// example, produce a list of all values, get counts, and calculate statistics.
print('List of property values', col.aggregate_array(prop));
print('Count of property values', col.aggregate_count(prop));
print('Count of distinct property values', col.aggregate_count_distinct(prop));
print('First collection element property value', col.aggregate_first(prop));
print('Histogram of property values', col.aggregate_histogram(prop));
print('Min of property values', col.aggregate_min(prop));
print('Max of property values', col.aggregate_max(prop));
// The following methods are applicable to numerical properties only.
print('Mean of property values', col.aggregate_mean(prop));
print('Sum of property values', col.aggregate_sum(prop));
print('Product of property values', col.aggregate_product(prop));
print('Std dev (sample) of property values', col.aggregate_sample_sd(prop));
print('Variance (sample) of property values', col.aggregate_sample_var(prop));
print('Std dev (total) of property values', col.aggregate_total_sd(prop));
print('Variance (total) of property values', col.aggregate_total_var(prop));
print('Summary stats of property values', col.aggregate_stats(prop));
// Note that if the property is formatted as a string, min and max will
// respectively return the first and last values according to alphanumeric
// order of the property values.
var propString = 'LANDSAT_SCENE_ID';
print('List of property values (string)', col.aggregate_array(propString));
print('Min of property values (string)', col.aggregate_min(propString));
print('Max of property values (string)', col.aggregate_max(propString));
  
    
  
  
    
  
  
  
  
    
  
    
  การตั้งค่า Python
  ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า
    สภาพแวดล้อม Python
  import ee
import geemap.core as geemap
  
    
    
      Colab (Python)
    
    
  # A Lansat 8 TOA image collection for a specific year and location.
col = ee.ImageCollection("LANDSAT/LC08/C02/T1_TOA").filterBounds(
    ee.Geometry.Point([-122.073, 37.188])).filterDate('2018', '2019')
# An image property of interest, percent cloud cover in this case.
prop = 'CLOUD_COVER'
# Use ee.ImageCollection.aggregate_* functions to fetch information about
# values of a selected property across all images in the collection. For
# example, produce a list of all values, get counts, and calculate statistics.
display('List of property values:', col.aggregate_array(prop))
display('Count of property values:', col.aggregate_count(prop))
display('Count of distinct property values:',
        col.aggregate_count_distinct(prop))
display('First collection element property value:', col.aggregate_first(prop))
display('Histogram of property values:', col.aggregate_histogram(prop))
display('Min of property values:', col.aggregate_min(prop))
display('Max of property values:', col.aggregate_max(prop))
# The following methods are applicable to numerical properties only.
display('Mean of property values:', col.aggregate_mean(prop))
display('Sum of property values:', col.aggregate_sum(prop))
display('Product of property values:', col.aggregate_product(prop))
display('Std dev (sample) of property values:', col.aggregate_sample_sd(prop))
display('Variance (sample) of property values:', col.aggregate_sample_var(prop))
display('Std dev (total) of property values:', col.aggregate_total_sd(prop))
display('Variance (total) of property values:', col.aggregate_total_var(prop))
display('Summary stats of property values:', col.aggregate_stats(prop))
# Note that if the property is formatted as a string, min and max will
# respectively return the first and last values according to alphanumeric
# order of the property values.
prop_string = 'LANDSAT_SCENE_ID'
display('List of property values (string):', col.aggregate_array(prop_string))
display('Min of property values (string):', col.aggregate_min(prop_string))
display('Max of property values (string):', col.aggregate_max(prop_string))
  
  
  
  
  
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
  อัปเดตล่าสุด 2025-10-30 UTC
  
  
  
    
      [null,null,["อัปเดตล่าสุด 2025-10-30 UTC"],[],["The content details the use of `aggregate_histogram` and other `aggregate_*` functions within `ee.ImageCollection`. These functions analyze a collection's objects, focusing on a specified property. `aggregate_histogram` specifically generates a histogram of values for the chosen property, returning a dictionary. Other `aggregate_*` functions compute statistics, such as min, max, mean, sum, counts, variance and more. They operate on numerical properties, but some handle strings as well, using alphanumeric ordering.\n"]]