公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.data.createAsset
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
根据 JSON 值创建资源。如需创建空的图片集合或文件夹,请传入一个“value”对象,该对象包含一个“type”键,其值是 ee.data.AssetType.* 之一(即“ImageCollection”或“Folder”)。
返回已保存资源的说明(包括生成的 ID),如果指定了回调,则返回 null。
用法 | 返回 |
---|
ee.data.createAsset(value, path, force, properties, callback) | 对象 |
参数 | 类型 | 详细信息 |
---|
value | 对象 | 一个对象,用于描述要创建的资源。 |
path | 字符串,可选 | 所需 ID(包括完整路径,可选)。 |
force | 布尔值,可选 | 强制覆盖。 |
properties | 对象,可选 | 要设置的属性的键和值 |
callback | 函数(可选) | 可选的回调。如果未提供,则以同步方式进行调用。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):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. |"]]