ee.data.createAsset
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.
Tạo một tài sản từ giá trị JSON. Để tạo một tập hợp hoặc thư mục hình ảnh trống, hãy truyền vào một đối tượng "value" có khoá "type" mà giá trị của khoá đó là một trong các giá trị ee.data.AssetType.* (tức là "ImageCollection" hoặc "Folder").
Trả về nội dung mô tả về tài sản đã lưu, bao gồm cả mã nhận dạng được tạo hoặc giá trị rỗng nếu bạn chỉ định một lệnh gọi lại.
Cách sử dụng | Giá trị trả về |
---|
ee.data.createAsset(value, path, force, properties, callback) | Đối tượng |
Đối số | Loại | Thông tin chi tiết |
---|
value | Đối tượng | Một đối tượng mô tả thành phần cần tạo. |
path | Chuỗi, không bắt buộc | Mã nhận dạng mong muốn (không bắt buộc), bao gồm cả đường dẫn đầy đủ. |
force | Boolean, không bắt buộc | Buộc ghi đè. |
properties | Đối tượng, không bắt buộc | Khoá và giá trị của các thuộc tính cần đặt |
callback | Hàm, không bắt buộc | Một lệnh gọi lại không bắt buộc. Nếu không được cung cấp, lệnh gọi sẽ được thực hiện đồng bộ. |
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-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eGenerates an Earth Engine asset from a JSON object, enabling the creation of image collections, folders, or other asset types.\u003c/p\u003e\n"],["\u003cp\u003eAllows specification of an asset ID, optional overwriting, and custom properties during asset creation.\u003c/p\u003e\n"],["\u003cp\u003eReturns asset details including a generated ID or utilizes a callback function for asynchronous operations.\u003c/p\u003e\n"],["\u003cp\u003eSupports creating empty image collections and folders by providing a JSON value with the specific "type" key.\u003c/p\u003e\n"]]],["The function `ee.data.createAsset` creates an asset from a JSON value. It accepts a `value` object describing the asset and an optional `path` for the asset ID. The `force` argument allows overwriting, and `properties` sets asset metadata. A `callback` enables asynchronous operation. Without a callback, it returns an object describing the asset, including the ID. An empty image collection or folder can be created by using the values from ee.data.AssetType.\n"],null,["# ee.data.createAsset\n\n\u003cbr /\u003e\n\nCreates an asset from a JSON value. To create an empty image collection or folder, pass in a \"value\" object with a \"type\" key whose value is one of ee.data.AssetType.\\* (i.e. \"ImageCollection\" or \"Folder\").\n\n\u003cbr /\u003e\n\nReturns a description of the saved asset, including a generated ID, or null if a callback is specified.\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------|---------|\n| `ee.data.createAsset(value, `*path* `, `*force* `, `*properties* `, `*callback*`)` | Object |\n\n| Argument | Type | Details |\n|--------------|--------------------|------------------------------------------------------------------------|\n| `value` | Object | An object describing the asset to create. |\n| `path` | String, optional | An optional desired ID, including full path. |\n| `force` | Boolean, optional | Force overwrite. |\n| `properties` | Object, optional | The keys and values of the properties to set |\n| `callback` | Function, optional | An optional callback. If not supplied, the call is made synchronously. |"]]