Earth Engine is introducing
noncommercial quota tiers to safeguard shared compute resources and ensure reliable performance for everyone. All noncommercial projects will need to select a quota tier by
April 27, 2026 or will use the Community Tier by default. Tier quotas will take effect for all projects (regardless of tier selection date) on
April 27, 2026.
Learn more.
ee.Reducer.group
Stay organized with collections
Save and categorize content based on your preferences.
Groups reducer records by the value of a given input and reduces each group with the given reducer.
| Usage | Returns | Reducer.group(groupField, groupName) | Reducer |
| Argument | Type | Details | this: reducer | Reducer | The reducer to apply to each group, without the group field. |
groupField | Integer, default: 0 | The field that contains record groups. |
groupName | String, default: "group" | The dictionary key that contains the group. Defaults to 'group'. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-19 UTC.
[null,null,["Last updated 2024-09-19 UTC."],[],["The `Reducer.group` function groups records based on a specified `groupField` (defaulting to field 0). It then applies a provided `reducer` to each group, excluding the grouping field. The result of the reducer on each group is stored under a `groupName` key (defaulting to \"group\"). The function itself returns a `Reducer` object. The `groupField` type can be an Integer.\n"]]