Pengumuman: Semua project nonkomersial yang terdaftar untuk menggunakan Earth Engine sebelum
15 April 2025 harus
memverifikasi kelayakan nonkomersial untuk mempertahankan akses Earth Engine.
ee.Feature.centroid
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Menampilkan fitur yang berisi titik di tengah komponen dimensi tertinggi dari geometri fitur. Komponen berdimensi lebih rendah diabaikan, sehingga sentroid geometri yang berisi dua poligon, tiga garis, dan satu titik sama dengan sentroid geometri yang hanya berisi dua poligon.
Penggunaan | Hasil |
---|
Feature.centroid(maxError, proj) | Fitur |
Argumen | Jenis | Detail |
---|
ini: feature | Elemen | Menghitung titik berat geometri default fitur ini. |
maxError | ErrorMargin, default: null | Jumlah maksimum error yang dapat ditoleransi saat melakukan reproyeksi yang diperlukan. |
proj | Proyeksi, default: null | Jika ditentukan, hasilnya akan berada dalam proyeksi ini. Jika tidak, maka akan menggunakan EPSG:4326. |
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
[null,null,["Terakhir diperbarui pada 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. |"]]