公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.ImageCollection.randomColumn
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
將一列決定性的偽隨機數新增至集合。輸出內容為雙精度浮點數。使用「均勻」分佈 (預設) 時,輸出值會落在 [0, 1] 的範圍內。使用「正常」分佈函式時,輸出值的 μ 和 σ 分別為 0 和 1,但沒有明確的限制。
用量 | 傳回 |
---|
ImageCollection.randomColumn(columnName, seed, distribution, rowKeys) | FeatureCollection |
引數 | 類型 | 詳細資料 |
---|
this:collection | FeatureCollection | 要新增隨機資料欄的輸入集合。 |
columnName | 字串,預設值為「random」 | 要新增的資料欄名稱。 |
seed | Long,預設值:0 | 產生隨機號碼時使用的種子。 |
distribution | 字串,預設值為「uniform」 | 要產生的隨機數分布類型,可選值為「uniform」或「normal」。 |
rowKeys | 清單,選用 | 屬性清單,應可用於唯一且可重複識別集合元素,用於產生隨機號碼。預設值為 [system:index]。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eAdds a new column of random numbers to an existing FeatureCollection.\u003c/p\u003e\n"],["\u003cp\u003eUsers can specify the column name, seed for reproducibility, and distribution type (uniform or normal).\u003c/p\u003e\n"],["\u003cp\u003eThe 'uniform' distribution generates numbers between 0 (inclusive) and 1 (exclusive), while the 'normal' distribution generates numbers with a mean of 0 and standard deviation of 1.\u003c/p\u003e\n"],["\u003cp\u003eThe output is a new FeatureCollection with the added random column.\u003c/p\u003e\n"]]],[],null,["# ee.ImageCollection.randomColumn\n\nAdds a column of deterministic pseudorandom numbers to a collection. The outputs are double-precision floating point numbers. When using the 'uniform' distribution (default), outputs are in the range of \\[0, 1). Using the 'normal' distribution, outputs have μ=0, σ=1, but have no explicit limits.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------------------------------|-------------------|\n| ImageCollection.randomColumn`(`*columnName* `, `*seed* `, `*distribution* `, `*rowKeys*`)` | FeatureCollection |\n\n| Argument | Type | Details |\n|--------------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `collection` | FeatureCollection | The input collection to which to add a random column. |\n| `columnName` | String, default: \"random\" | The name of the column to add. |\n| `seed` | Long, default: 0 | A seed used when generating the random numbers. |\n| `distribution` | String, default: \"uniform\" | The distribution type of random numbers to produce; one of 'uniform' or 'normal'. |\n| `rowKeys` | List, optional | A list of properties that should uniquely and repeatably identify an element of the collection, used to generate the random number. Defaults to \\[system:index\\]. |"]]