公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Feature.closestPoints
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
傳回的字典最多包含兩個項目,分別代表每個輸入特徵幾何圖形上最接近其他輸入幾何圖形的點。如果任一幾何圖形為空,系統會傳回空白字典。如果兩個幾何體都不受限,字典會為「左」和「右」提供任意點。如果其中一個幾何圖形不受限,則字典會針對「左」和「右」兩者,在受限的幾何圖形中包含任意點。
用量 | 傳回 |
---|
Feature.closestPoints(right, maxError, proj) | 物件 |
引數 | 類型 | 詳細資料 |
---|
這個:left | 元素 | 包含幾何圖形的特徵,用做運算的左側運算元。 |
right | 元素 | 包含幾何的特徵,用做運算的右運算元。 |
maxError | ErrorMargin,預設值:null | 執行任何必要重投影時可容許的最大誤差量。 |
proj | 投影,預設值:null | 執行作業的投影。如未指定,系統會以球面座標系統執行作業,而球面上的線性距離會以公尺為單位。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eReturns a dictionary with points on each feature closest to the other, useful for proximity analysis.\u003c/p\u003e\n"],["\u003cp\u003eHandles various geometry types, including empty, unbounded, and bounded cases with specific behaviors.\u003c/p\u003e\n"],["\u003cp\u003eAccepts optional arguments for error tolerance (\u003ccode\u003emaxError\u003c/code\u003e) and projection (\u003ccode\u003eproj\u003c/code\u003e) to refine the operation.\u003c/p\u003e\n"],["\u003cp\u003eUses 'left' and 'right' keys in the dictionary to represent the closest points on respective input features.\u003c/p\u003e\n"],["\u003cp\u003eAccessible via \u003ccode\u003eFeature.closestPoints()\u003c/code\u003e method, requiring two feature inputs for comparison.\u003c/p\u003e\n"]]],[],null,["# ee.Feature.closestPoints\n\nReturns a dictionary containing up to two entries representing a point on each input feature's geometry that is closest to the geometry of the other input. If either geometry is empty, an empty dictionary is returned. If both geometries are unbounded, the dictionary has an arbitrary point for both 'left' and 'right'. If one geometry is unbounded, the dictionary has an arbitrary point contained in the bounded geometry for both 'left' and 'right'.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------------|---------|\n| Feature.closestPoints`(right, `*maxError* `, `*proj*`)` | Object |\n\n| Argument | Type | Details |\n|--------------|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `left` | Element | The feature containing the geometry used as the left operand of the operation. |\n| `right` | Element | The feature containing the geometry used as the right operand of the operation. |\n| `maxError` | ErrorMargin, default: null | The maximum amount of error tolerated when performing any necessary reprojection. |\n| `proj` | Projection, default: null | The projection in which to perform the operation. If not specified, the operation will be performed in a spherical coordinate system, and linear distances will be in meters on the sphere. |"]]