Объявление : Все некоммерческие проекты, зарегистрированные для использования Earth Engine до
15 апреля 2025 года, должны
подтвердить некоммерческое право на сохранение доступа к Earth Engine.
ee.Feature.centroid
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Возвращает объект, содержащий точку в центре компонентов геометрии объекта с наибольшим размером. Компоненты с меньшим размером игнорируются, поэтому центроид геометрии, содержащей два полигона, три линии и точку, эквивалентен центроиду геометрии, содержащей только два полигона.
Использование | Возврат | Feature. centroid ( maxError , proj ) | Особенность |
Аргумент | Тип | Подробности | это: feature | Элемент | Вычисляет центроид геометрии этого объекта по умолчанию. |
maxError | ErrorMargin, по умолчанию: null | Максимально допустимая погрешность при выполнении любого необходимого перепроецирования. |
proj | Проекция, по умолчанию: null | Если указано, результат будет в этой проекции. В противном случае — в EPSG:4326. |
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-24 UTC.
[null,null,["Последнее обновление: 2025-07-24 UTC."],[[["\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. |"]]