Earth Engine introduit des
niveaux de quota non commerciaux pour protéger les ressources de calcul partagées et garantir des performances fiables pour tous. Tous les projets non commerciaux devront sélectionner un niveau de quota d'ici le
27 avril 2026, faute de quoi le niveau "Communauté" sera appliqué par défaut. Les quotas de niveau s'appliqueront à tous les projets (quelle que soit la date de sélection du niveau) à compter du
27 avril 2026.
En savoir plus
ee.ImageCollection.aggregate_sample_var
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Agrège une propriété donnée des objets d'une collection, en calculant la variance d'échantillon des valeurs de la propriété sélectionnée.
| Utilisation | Renvoie |
|---|
ImageCollection.aggregate_sample_var(property) | Nombre |
| Argument | Type | Détails |
|---|
ceci : collection | FeatureCollection | Collection à agréger. |
property | Chaîne | Propriété à utiliser pour chaque élément de la collection. |
Exemples
Éditeur de code (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));
Configuration de Python
Consultez la page
Environnement Python pour en savoir plus sur l'API Python et sur l'utilisation de geemap pour le développement interactif.
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))
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/10/30 (UTC).
[null,null,["Dernière mise à jour le 2025/10/30 (UTC)."],[],["The provided code demonstrates how to use `aggregate_*` functions on an `ImageCollection` to derive information about a specified property. Actions include listing all property values, getting counts, finding the first element's property value, creating histograms, and calculating statistical measures like min, max, mean, sum, product, standard deviation, and variance. These methods work on numeric properties, while string property methods are restricted to min and max (alphanumeric order).\n"]]