Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain access. If you have not verified by September 26, 2025, your access may be on hold.
ee.Image.reduceConnectedComponents
Stay organized with collections
Save and categorize content based on your preferences.
Applies a reducer to all of the pixels inside of each 'object'. Pixels are considered to belong to an object if they are connected (8-way) and have the same value in the 'label' band. The label band is only used to identify the connectedness; the rest are provided as inputs to the reducer.
Usage | Returns | Image.reduceConnectedComponents(reducer, labelBand, maxSize) | Image |
Argument | Type | Details | this: image | Image | The input image. |
reducer | Reducer | The reducer to apply to pixels within the connected component. |
labelBand | String, default: null | The name of the band to use to detect connectedness. If unspecified, the first band is used. |
maxSize | Integer, default: 256 | Size of the neighborhood to consider when aggregating values. Any objects larger than maxSize in either the horizontal or vertical dimension will be masked, since portions of the object might be outside of the neighborhood. |
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-07-13 UTC.
[null,null,["Last updated 2024-07-13 UTC."],[],[]]