我在街景中上传了几张照片,我想使用Python客户端库来更新它的元数据。下面是我的代码片段:
from google.proto.streetview.publish.v1 import resources_pb2
from google.streetview.publish.v1 import street_view_publish_service_client as client
from google.protobuf import field_mask_pb2
streetview_client = client.StreetViewPublishServiceClient(credentials=credentials)
for photo in streetview_client.list_photos(0, ''):
con = resources_pb2.Connection()
target_id = resources_pb2.PhotoId()
target_id.id = "photo_id"
con.target.id = target_id.id
photo.connections.extend([con])
update_mask = field_mask_pb2.FieldMask()
update_mask.FromJsonString("connections")
response = streetview_client.update_photo(photo, update_mask)
break
我想连接这两张照片,所以我将目标id添加到查询照片中,并将字段“connections”添加到update\u mask中。
update_photo
调用后的结果是以下错误消息:
google.gax.errors.RetryError: RetryError(Exception occurred in retry method that was not classified as transient, caused by <_Rendezvous of RPC that terminated with (StatusCode.INVALID_ARGUMENT, Empty level name is not accepted.)>)
有什么提示吗?你知道吗
为了在两张照片之间建立连接,需要使用^{} 。} 的元数据。他说
Connections
应该设置在Photo
的正下方。另外,请注意需要实现的^{下面是一个示例代码片段。他说
相关问题 更多 >
编程相关推荐