ee.Feature.centroid
Returns a feature containing the point at the center of the highest-dimension components of the geometry of a feature. Lower-dimensional components are ignored, so the centroid of a geometry containing two polygons, three lines and a point is equivalent to the centroid of a geometry containing just the two polygons.
Usage | Returns | Feature.centroid(maxError, proj) | Feature |
Argument | Type | Details | this: feature | Element | Calculates the centroid of this feature's default geometry. |
maxError | ErrorMargin, default: null | The maximum amount of error tolerated when performing any necessary reprojection. |
proj | Projection, default: null | If specified, the result will be in this projection. Otherwise it will be in EPSG:4326. |
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-06-05 UTC.
[null,null,["Last updated 2024-06-05 UTC."],[[["Returns a feature with a point geometry representing the center of the highest-dimension component(s) of the input feature's geometry."],["Lower-dimensional components like lines and points within the input geometry are disregarded when calculating the centroid."],["The function can accept an optional `maxError` for reprojection tolerance and an optional `proj` to specify the output projection, defaulting to EPSG:4326."],["It is accessible through the `Feature.centroid()` method, taking the input feature, optional error margin, and optional projection as arguments."]]],[]]