公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Feature.centroid
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
返回一个要素,其中包含要素几何图形的最高维度组成部分的中心点。系统会忽略低维度的组成部分,因此包含两个多边形、三条线和一个点的几何图形的形心与仅包含这两个多边形的几何图形的形心相同。
用法 | 返回 |
---|
Feature.centroid(maxError, proj) | 功能 |
参数 | 类型 | 详细信息 |
---|
此:feature | 元素 | 计算相应地图项默认几何图形的形心。 |
maxError | ErrorMargin,默认值:null | 执行任何必要的重新投影时可容忍的最大误差量。 |
proj | 投影,默认值:null | 如果指定了此参数,结果将采用此投影。否则,它将采用 EPSG:4326。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eReturns a feature with a point geometry representing the center of the highest-dimension component(s) of the input feature's geometry.\u003c/p\u003e\n"],["\u003cp\u003eLower-dimensional components like lines and points within the input geometry are disregarded when calculating the centroid.\u003c/p\u003e\n"],["\u003cp\u003eThe function can accept an optional \u003ccode\u003emaxError\u003c/code\u003e for reprojection tolerance and an optional \u003ccode\u003eproj\u003c/code\u003e to specify the output projection, defaulting to EPSG:4326.\u003c/p\u003e\n"],["\u003cp\u003eIt is accessible through the \u003ccode\u003eFeature.centroid()\u003c/code\u003e method, taking the input feature, optional error margin, and optional projection as arguments.\u003c/p\u003e\n"]]],["The `centroid` method calculates the center point of a feature's highest-dimension geometry, disregarding lower-dimensional parts. It returns a new feature representing this centroid. The method accepts optional arguments: `maxError` defines the tolerated reprojection error, and `proj` specifies the output projection (defaulting to EPSG:4326). The method operates on the default geometry of a specified `feature`.\n"],null,["# ee.Feature.centroid\n\nReturns 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.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------|---------|\n| Feature.centroid`(`*maxError* `, `*proj*`)` | Feature |\n\n| Argument | Type | Details |\n|-----------------|----------------------------|-----------------------------------------------------------------------------------------|\n| this: `feature` | Element | Calculates the centroid of this feature's default geometry. |\n| `maxError` | ErrorMargin, default: null | The maximum amount of error tolerated when performing any necessary reprojection. |\n| `proj` | Projection, default: null | If specified, the result will be in this projection. Otherwise it will be in EPSG:4326. |"]]