公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.data.createAsset
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
使用 JSON 值建立資產。如要建立空白的圖片集合或資料夾,請傳遞「value」物件,其中包含「type」鍵,值為 ee.data.AssetType.* (即「ImageCollection」或「Folder」)。
傳回已儲存資產的說明 (包括產生的 ID),如果指定回呼,則傳回空值。
用量 | 傳回 |
---|
ee.data.createAsset(value, path, force, properties, callback) | 物件 |
引數 | 類型 | 詳細資料 |
---|
value | 物件 | 說明要建立的資產的物件。 |
path | 字串 (選用) | 選填的所需 ID,包括完整路徑。 |
force | 布林值 (選填) | 強制覆寫。 |
properties | 物件 (選用) | 要設定的屬性鍵和值 |
callback | 函式 (選用) | 選用回呼。如未提供,系統會同步發出呼叫。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\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. |"]]