在第 3 步中上传照片的元数据时,在谷歌街景中出现错误:
{
"error": {
"status": "INVALID_ARGUMENT",
"message": "The API Key and the authentication credential are from different projects.",
"code": 400,
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"url": "https://console.developers.google.com/project/3624944027/apiui/credential",
"description": "Google developer console API key"
}
]
}
]
}
}
Run Code Online (Sandbox Code Playgroud) 我在python中使用photo.update请求进行panos(360全景图像)连接.我只能将一个全景连接到另一个全景,但我想将一个全景连接到多个全景.我没有取得成功的结果.
我使用Python发送了以下photoUpdate请求:
update_photo_url = 'https://streetviewpublish.googleapis.com/v1/photo/{}?key={}&updateMask=connections'.format("pano_1","AIzdesdfyxscvvvvvvvvvvvvvvv")
headers = {"Authorization": "Bearer {}".format("ya29.Glx6BO91jWbjzLQKYPvP16fhT-jyOEnIdnoRcZcU9uYCqzwH3Dkuf-qf_kzUc2ykYOyVTZCfaGjOEAScsJK7WgS4NE9gfS6bSobWDIMdfpfY7SPzRMmxi4kfTrmsRQ"), "Content-Length": "0", "Content-Type": "application/json"}
update_body = {
[
{
"photo": {
"photoId": {
"id": "pano_1"
},
"connections": {
"target": {
"id": "pano_2"
},
"target": {
"id": "pano_3"
}
},
}
}
]
}
update_response = requests.put(update_photo_url,headers=headers,json=update_body)
update_response.text
Run Code Online (Sandbox Code Playgroud)
错误:
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"\": Root element must be a message.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid JSON …Run Code Online (Sandbox Code Playgroud) 当我使用给定的Street View API进行上传时
Request an Upload URL
$ curl --request POST \
--url 'https://streetviewpublish.googleapis.com/v1/photo:startUpload?key=YOUR_API_KEY' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Length: 0'
Upload the photo bytes to the Upload URL
$ curl --request POST \
--url 'UPLOAD_URL' \
--upload-file 'PATH_TO_FILE' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
Run Code Online (Sandbox Code Playgroud)
但它不工作..
它给我的错误是在请求中找不到文件。
有人可以帮我这个忙吗..
先感谢您。
google-maps-api-3 google-street-view google-streetview-publish