gpt4 book ai didi

json - 从经纬度坐标获取街景全景 ID

转载 作者:行者123 更新时间:2023-12-04 22:59:44 25 4
gpt4 key购买 nike

我正在尝试从经纬度坐标获取街景全景 ID,我发现此查询将返回一个包含全景图的 JSON 文件(例如 JMUfE4l0ucICvD4_BaIGsw )。

https://cbks0.google.com/cbk?cb_client=apiv3&authuser=0&hl=en&output=polygon&it=1%3A1&rank=closest&ll=30.2983995,35.1334873&radius=50

只需将坐标替换为您喜欢的任何内容。

但这是我的问题:我怎样才能让它适用于像以色列小道这样的越野?当我输入这条越野小径的任何坐标时,它总是返回一个空的 JSON 文件。 (例如,我知道 30.7451333,34.8850511 是全景图,但它不会返回全景图。)我做错了什么?谢谢。

最佳答案

您用于获取全景 ID 的 URL 是未记录的功能。 Google map 的服务条款禁止通过此类 URL 访问服务。
查看服务条款的第 10.1 (a) 段。

No access to APIs or Content except through the Service. You will not access the Maps API(s) or the Content except through the Service. For example, you must not access map tiles or imagery through interfaces or channels (including undocumented Google interfaces) other than the Maps API(s).



https://developers.google.com/maps/terms#10-license-restrictions

您应该使用 Street View Image Metadata 的 API在你的情况下。

例如要获取 30.7451333,34.8850511 的全景 ID,您可以执行以下查询
https://maps.googleapis.com/maps/api/streetview/metadata?location=30.7451333%2C34.8850511&key=API_KEY
此请求返回以下响应
{
"copyright":"© 2017 Google",
"date":"2015-05",
"location":{
"lat":30.74513326023706,
"lng":34.88505109084099
},
"pano_id":"Ig2uuF7itfCs8ksgjlJaTQ",
"status":"OK"
}

现在您有了全景 ID Ig2uuF7itfCs8ksgjlJaTQ。让它与街景 API 一起使用:

<img src="https://maps.googleapis.com/maps/api/streetview?pano=Ig2uuF7itfCs8ksgjlJaTQ&size=600x400" title="" />


希望能帮助到你!

关于json - 从经纬度坐标获取街景全景 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42019281/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com