ee.ImageCollection.randomColumn
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Thêm một cột gồm các số ngẫu nhiên giả định có thể xác định vào một tập hợp. Kết quả là các số dấu phẩy động có độ chính xác kép. Khi sử dụng phương thức phân phối "đồng nhất" (mặc định), kết quả sẽ nằm trong khoảng [0, 1). Khi sử dụng phân phối "bình thường", đầu ra có μ=0, σ=1 nhưng không có giới hạn rõ ràng.
Cách sử dụng | Giá trị trả về |
---|
ImageCollection.randomColumn(columnName, seed, distribution, rowKeys) | FeatureCollection |
Đối số | Loại | Thông tin chi tiết |
---|
this: collection | FeatureCollection | Bộ sưu tập đầu vào để thêm một cột ngẫu nhiên. |
columnName | Chuỗi, mặc định: "random" | Tên của cột cần thêm. |
seed | Dài, mặc định: 0 | Giá trị khởi tạo được dùng khi tạo số ngẫu nhiên. |
distribution | Chuỗi, mặc định: "đồng nhất" | Loại phân phối số ngẫu nhiên cần tạo; một trong hai loại "đồng nhất" hoặc "bình thường". |
rowKeys | Danh sách, không bắt buộc | Danh sách các thuộc tính phải xác định một phần tử của tập hợp một cách duy nhất và lặp lại, dùng để tạo số ngẫu nhiên. Giá trị mặc định là [system:index]. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\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\\]. |"]]