使用Google街景发布API

时间:2017-07-05 09:11:00

标签: python json google-api google-street-view google-streetview-publish

使用batchUpadte方法,我尝试连接源图像中的多个360图像。

e.g。下面是我对batchUpdate方法的python请求:

update_photo_url = 'https://streetviewpublish.googleapis.com/v1/photos:batchUpdate'

headers = {"Authorization": "Bearer {}".format("ya29.Glx6BO91jWbj...."), "Content-Length": "0", "Content-Type": "application/json"}

update_body = {
  "updatePhotoRequests": [
    {
      "updateMask": "connections",
      "photo": {
        "photoId": {
          "id": "image_1"
        },
        "connections": [
          {
            "target": {
              "id": "image_2"
            }
          },
          {
            "target": {
              "id": "image_3"
            }
          }
        ]
      }
    },
    {
      "updateMask": "connections",
      "photo": {
        "photoId": {
          "id": "image_3"
        },
        "connections": [
          {
            "target": {
              "id": "image_4"
            }
          }
        ]
      }
    }
  ]
}
update_response = requests.post(update_photo_url,headers=headers,json=update_body)
update_response.text  

发送此请求后,我获得状态200确定但是有一个问题,我有四个图像。我在图像之间建立连接,如下所示:

image_1 -> image_2, image_3
image_3 -> image_4

使用上面的代码,我能够从image_2 - > image_1,image_1 - > image_3,image_3 - > image_1,image_3 - > image_4和image_4 - > image_3但是为什么我无法从image_1转到 - > IMAGE_2

请帮我解决此问题。谁能说出来,我的请求有什么问题?

1 个答案:

答案 0 :(得分:0)

您是否检查过移动街景应用或浏览器中的连接?浏览器有时会添加或丢失连接,但我发现移动应用程序是查看"基本事实的最佳方式。存储在Googles服务器上。