公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.data.updateAsset
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
更新资产。
经过身份验证的用户必须是相应资产的写入者或所有者。
用法 | 返回 |
---|
ee.data.updateAsset(assetId, asset, updateFields, callback) | 对象 |
参数 | 类型 | 详细信息 |
---|
assetId | 字符串 | 要更新的资产的 ID。 |
asset | api.EarthEngineAsset | 已更新的资源版本,仅包含要更新的字段的新值。只能更新“start_time”“end_time”和“properties”字段。如果“updateMask”中指定了某个值,但“asset”中未设置该值,则该值将从相应素材资源中删除。 |
updateFields | List<String> | 要更新的字段名称的列表。此参数可能包含:
“start_time”或“end_time”,用于更新相应的时间戳;
“properties.PROPERTY_NAME”,用于更新指定属性;
“properties”,用于更新所有属性。如果列表为空,则所有属性和两个时间戳都将更新。 |
callback | 函数(可选) | 可选的回调。如果未提供,则会同步进行调用。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eUpdates specified fields or all properties and timestamps of an Earth Engine asset.\u003c/p\u003e\n"],["\u003cp\u003eRequires writer or owner authentication for the asset being updated.\u003c/p\u003e\n"],["\u003cp\u003eAllows updating start/end times and properties, with the option to delete values by specifying them in \u003ccode\u003eupdateFields\u003c/code\u003e but omitting them in \u003ccode\u003easset\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes the \u003ccode\u003eee.data.updateAsset\u003c/code\u003e function with asset ID, updated asset details, and optional fields to update and callback.\u003c/p\u003e\n"]]],["This function updates an existing asset, requiring the user to be a writer or owner. It accepts the `assetId`, an `asset` object containing new field values, and a list of `updateFields`. Updatable fields include \"start_time\", \"end_time\", and \"properties\". Specifying a field in `updateFields` but not in `asset` deletes it. An empty `updateFields` list updates all properties and timestamps. The function returns an object, with an optional callback for asynchronous operation.\n"],null,["# ee.data.updateAsset\n\n\u003cbr /\u003e\n\nUpdates an asset.\n\n\u003cbr /\u003e\n\nThe authenticated user must be a writer or owner of the asset.\n\n| Usage | Returns |\n|-------------------------------------------------------------------|---------|\n| `ee.data.updateAsset(assetId, asset, updateFields, `*callback*`)` | Object |\n\n| Argument | Type | Details |\n|----------------|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `assetId` | String | The ID of the asset to update. |\n| `asset` | api.EarthEngineAsset | The updated version of the asset, containing only the new values of the fields to be updated. Only the \"start_time\", \"end_time\", and \"properties\" fields can be updated. If a value is named in \"updateMask\", but is unset in \"asset\", then that value will be deleted from the asset. |\n| `updateFields` | List\\\u003cString\\\u003e | A list of the field names to update. This may contain: \"start_time\" or \"end_time\" to update the corresponding timestamp, \"properties.PROPERTY_NAME\" to update a given property, or \"properties\" to update all properties. If the list is empty, all properties and both timestamps will be updated. |\n| `callback` | Function, optional | An optional callback. If not supplied, the call is made synchronously. |"]]