Method: photo.update
更新 Photo
的元数据,例如姿势、地点关联、连接等。不支持更改照片的像素。
系统只会使用 updateMask
字段中指定的字段。如果 updateMask
不存在,则更新适用于所有字段。
此方法会返回以下错误代码:
HTTP 请求
PUT https://streetviewpublish.googleapis.com/v1/photo/{photo.photoId.id}
网址采用 gRPC 转码语法。
路径参数
参数 |
photo.photoId.id |
string
照片的唯一标识符。
|
查询参数
参数 |
updateMask |
string (FieldMask format)
必需。用于标识要更新的照片元数据中的字段的遮罩。如果不存在,则此请求中的旧 Photo 元数据会完全替换为新的 Photo 元数据。如果指定了无效字段,更新将失败。可通过逗号分隔列表指定多个字段。 有效字段如下:
pose.heading
pose.lat_lng_pair
pose.pitch
pose.roll
pose.level
pose.altitude
connections
places
注意:如果 updateMask 包含重复字段,则整个重复值集会被新内容替换。例如,如果 updateMask 包含 connections 且 UpdatePhotoRequest.photo.connections 为空,则系统会移除所有连接。
|
响应正文
如果成功,则响应正文包含一个 Photo
实例。
授权范围
需要以下 OAuth 作用域:
https://www.googleapis.com/auth/streetviewpublish
有关详情,请参阅 OAuth 2.0 概览。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-01。
[null,null,["最后更新时间 (UTC):2023-12-01。"],[[["Updates a Photo's metadata, such as pose, connections, and places, but not the image pixels themselves."],["Uses an `updateMask` to specify which fields to update; if omitted, all fields are updated."],["Requires the `https://www.googleapis.com/auth/streetviewpublish` OAuth scope for authorization."],["Returns the updated Photo object if successful."],["May return errors if permissions are lacking, the request is invalid, the Photo doesn't exist, or is still being indexed."]]],["This describes how to update a photo's metadata using the Street View Publish API. It uses a `PUT` request to a specific URL with a photo ID in the path. The `updateMask` query parameter specifies which metadata fields to modify. The request body contains the new metadata, and the response body returns the updated photo. Key metadata includes pose, connections, and places. Authorization requires a specific OAuth scope. Possible errors include permission, invalid argument, not found, or unavailability.\n"]]