AI-generated Key Takeaways
-
Aggregates the product of values for a specified property in a collection.
-
Returns a single number as the result of the aggregation.
-
Requires a FeatureCollection and a string representing the property name as arguments.
-
Provides examples in both JavaScript and Python for calculating the product of power plant capacities.
| Usage | Returns |
|---|---|
FeatureCollection.
aggregate_product
(property)
|
Number |
| Argument | Type | Details |
|---|---|---|
|
this:
collection
|
FeatureCollection | The collection to aggregate over. |
property
|
String | The property to use from each element of the collection. |
Examples
Code Editor (JavaScript)
// FeatureCollection of power plants in Belgium. var fc = ee . FeatureCollection ( 'WRI/GPPD/power_plants' ) . filter ( 'country_lg == "Belgium"' ); print ( 'Product of power plant capacities (MW)' , fc . aggregate_product ( 'capacitymw' )); // 2.149198109e+109
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"' ) display ( 'Product of power plant capacities (MW):' , fc . aggregate_product ( 'capacitymw' )) # 2.149198109e+109

