ee.Feature.centroid
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Gibt ein Feature zurück, das den Punkt in der Mitte der Komponenten mit der höchsten Dimension der Geometrie eines Features enthält. Komponenten mit niedrigerer Dimension werden ignoriert. Der Schwerpunkt einer Geometrie mit zwei Polygonen, drei Linien und einem Punkt entspricht also dem Schwerpunkt einer Geometrie, die nur die beiden Polygone enthält.
Nutzung | Ausgabe |
---|
Feature.centroid(maxError, proj) | Funktion |
Argument | Typ | Details |
---|
So gehts: feature | Element | Berechnet den Schwerpunkt der Standardgeometrie dieses Elements. |
maxError | ErrorMargin, Standardwert: null | Die maximale Fehlergröße, die bei einer erforderlichen Rückprojektion toleriert wird. |
proj | Projektion, Standardwert: null | Falls angegeben, wird das Ergebnis in dieser Projektion zurückgegeben. Andernfalls wird EPSG:4326 verwendet. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (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. |"]]