公告:所有在
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 | 长整数,默认值:0 | 生成随机数时使用的种子。 |
distribution | 字符串,默认值:“uniform” | 要生成的随机数的分布类型;可以是“均匀”或“正态”之一。 |
rowKeys | 列表,可选 | 应唯一且可重复地标识集合元素的属性列表,用于生成随机数字。默认值为 [system:index]。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):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\\]. |"]]