Annuncio: tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del
15 aprile 2025 devono
verificare l'idoneità non commerciale per mantenere l'accesso a Earth Engine.
ee.Feature.centroid
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Restituisce una funzionalità contenente il punto al centro dei componenti di dimensione più alta della geometria di una funzionalità. I componenti di dimensioni inferiori vengono ignorati, quindi il centroide di una geometria contenente due poligoni, tre linee e un punto è equivalente al centroide di una geometria contenente solo i due poligoni.
Utilizzo | Resi |
---|
Feature.centroid(maxError, proj) | Funzionalità |
Argomento | Tipo | Dettagli |
---|
questo: feature | Elemento | Calcola il centroide della geometria predefinita di questa funzionalità. |
maxError | ErrorMargin, valore predefinito: null | La quantità massima di errore tollerata durante l'esecuzione di qualsiasi riproiezione necessaria. |
proj | Proiezione, valore predefinito: null | Se specificato, il risultato sarà in questa proiezione. In caso contrario, sarà in EPSG:4326. |
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 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. |"]]