如何使用街景发布 API 发布多级拍摄



我正在尝试使用街景发布API发布多级拍摄,但关卡没有显示在谷歌地图上。

我已经发送了下面的python请求,用于上传照片的元数据:

要求 1 级:

metadata_upload_url = "https://streetviewpublish.googleapis.com/v1/photo?key={}".format(API_KEY)
headers = {"Authorization": "Bearer {}".format(ACCESS_KEY), "Content-Length": "0",
"Content-Type": "application/json"}
data = {
"uploadReference": {
"uploadUrl": "https://streetviewpublish.googleapis.com/media/user/100547264652003378315/photo/5844140439745949662"
},
"pose": {
"latLngPair": {
"latitude": 18.51314,
"longitude": 73.85670
},
"heading": 0.0,
"pitch": 0.0,
"level": {
"number": 1,
"name": "arr"
}
},
"places": [{
"placeId": "ChIJb3sWh27AwjsRkiAc5rqoVvs",
}],
}
meta_photo_request = requests.post(metadata_upload_url, json=data, headers=headers)
photoid = meta_photo_request.json()['photoId']['id']

要求 2 级:

metadata_upload_url = "https://streetviewpublish.googleapis.com/v1/photo?key={}".format(API_KEY)
headers = {"Authorization": "Bearer {}".format(ACCESS_KEY), "Content-Length": "0",
"Content-Type": "application/json"}
data = {
"uploadReference": {
"uploadUrl": "https://streetviewpublish.googleapis.com/media/user/100547264652003378315/photo/5844140439745949662"
},
"pose": {
"latLngPair": {
"latitude": 18.51315,
"longitude": 73.85671
},
# "altitude": 500,
"heading": 0.0,
"pitch": 0.0,
"level": {
"number": 2,
"name": "brr"
}
},
"places": [{
"placeId": "ChIJb3sWh27AwjsRkiAc5rqoVvs",
}],
}
meta_photo_request = requests.post(metadata_upload_url, json=data, headers=headers)
photoid = meta_photo_request.json()['photoId']['id']  

状态为 200 的结果

{
"results": [
{
"status": {
"code": 200
},
"photo": {
"photoId": {
"id": "CAoSLEFGMVFpcE5UOXQzcDBwa0kwTGVROG81Nm1Qc05HdFo4djROUjB4YXM0UGNf"
},
"pose": {
"latLngPair": {
"latitude": 18.51315,
"longitude": 73.856709999999993
},
"altitude": "NaN",
"pitch": "NaN",
"roll": "NaN",
"level": {}
},
"connections": [
{
"target": {
"id": "CAoSLEFGMVFpcE9VaEpXRU03SWZod0dkdFVJUDgwNHhsY0p2YWktcTVldHVmZ0ZV"
}
}
],
"captureTime": "2017-07-27T00:00:00Z",
"places": [
{
"placeId": "ChIJb3sWh27AwjsRkiAc5rqoVvs"
}
],
"thumbnailUrl": "https://lh3.googleusercontent.com/p/AF1QipNT9t3p0pkI0LeQ8o56mPsNGtZ8v4NR0xas4Pc_=-no",
"viewCount": "7",
"shareLink": "https://www.google.com/maps/@18.51315,73.85671,0a,75y/data=!3m6!1e1!3m4!1s-W7huarDveuA%2FWXnJ6zKkzAI%2FAAAAAAAAia8%2FhTVrH8aZO54yds7DERdBRcwHUvgzg_6BACLIBGAYYCw!2e4!3e11!6s%2F%2Flh3.googleusercontent.com%2F-W7huarDveuA%2FWXnJ6zKkzAI%2FAAAAAAAAia8%2FhTVrH8aZO54yds7DERdBRcwHUvgzg_6BACLIBGAYYCw%2Fno%2Fphoto.jpg"
}
},

{
"status": {
"code": 200
},
"photo": {
"photoId": {
"id": "CAoSLEFGMVFpcE9VaEpXRU03SWZod0dkdFVJUDgwNHhsY0p2YWktcTVldHVmZ0ZV"
},
"pose": {
"latLngPair": {
"latitude": 18.51314,
"longitude": 73.8567
},
"altitude": "NaN",
"pitch": "NaN",
"roll": "NaN",
"level": {}
},
"connections": [
{
"target": {
"id": "CAoSLEFGMVFpcE5UOXQzcDBwa0kwTGVROG81Nm1Qc05HdFo4djROUjB4YXM0UGNf"
}
}
],
"captureTime": "2017-07-27T00:00:00Z",
"places": [
{
"placeId": "ChIJb3sWh27AwjsRkiAc5rqoVvs"
}
],
"thumbnailUrl": "https://lh3.googleusercontent.com/p/AF1QipOUhJWEM7IfhwGdtUIP804xlcJvai-q5etufgFU=-no",
"viewCount": "8",
"shareLink": "https://www.google.com/maps/@18.51314,73.8567,0a,75y/data=!3m6!1e1!3m4!1s-huvo4fBlnjw%2FWXnJARb4q7I%2FAAAAAAAAia0%2FJDjPyYRA2L8S4n48xtakPUSglymSICRIACLIBGAYYCw!2e4!3e11!6s%2F%2Flh3.googleusercontent.com%2F-huvo4fBlnjw%2FWXnJARb4q7I%2FAAAAAAAAia0%2FJDjPyYRA2L8S4n48xtakPUSglymSICRIACLIBGAYYCw%2Fno%2Fphoto.jpg"
}
}
]
}  

在结果中,级别对象为空,而我输入了级别名称和编号。我不明白为什么它显示为空。

谁能告诉我在谷歌地图上发布多级拍摄应该遵循什么步骤?

您需要确保所有照片彼此非常接近(~5m(以使级别控件显示出来。 您可以尝试使用单独的 photo.update 调用发送关卡数据。不要忘记使用正确的更新掩码。

相关内容

  • 没有找到相关文章