从lat/long坐标获取街道全景图ID

时间:2021-11-17 21:20:00

I'm trying to get a Street View panorama ID from lat/long coordinates, and I've found this query will return a JSON file containing the panoid (such as JMUfE4l0ucICvD4_BaIGsw).

我正在尝试从lat/long坐标获取街景视图全景ID,我发现该查询将返回包含panoid(如JMUfE4l0ucICvD4_BaIGsw)的JSON文件。

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

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

Just replace the coordinates to whatever you like.

把坐标换成你喜欢的。

But here's my question: How can I get this to work for something off-road like the Israel trail? When I put in any coordinates from this off-road trail, it always returns an empty JSON file. (For instance, I know 30.7451333,34.8850511 is a panorama, yet it won't return the panoid.) What am I doing wrong? Thanks.

但我的问题是:我怎样才能让它在像以色列之路这样的越野项目中发挥作用呢?当我从这个越野路径输入任何坐标时,它总是返回一个空的JSON文件。(例如,我知道30.7451333,34.8850511是全景图,但它不会返回panoid。)我做错了什么?谢谢。

1 个解决方案

#1


1  

The URL that you use to get panorama IDs is undocumented feature. The Terms of Service of Google Maps prohibits access to service via such URLs. Have a look at paragraph 10.1 (a) of ToS.

用于获取全景图id的URL是无文档说明的特性。谷歌映射的服务条款禁止通过此类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).

不能访问api或内容,除非通过服务。除非通过服务,否则您不会访问Maps API或内容。例如,除了Maps API之外,您不能通过接口或通道(包括未文档化的谷歌接口)访问地图块或图像。

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

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

You should use the API which is Street View Image Metadata in your case.

在您的案例中,应该使用的API是Street View图像元数据。

For example to get panorama ID for 30.7451333,34.8850511 you can execute the following query

例如,要获得307451333、34.8850511的全景ID,您可以执行以下查询。

https://maps.googleapis.com/maps/api/streetview/metadata?location=30.7451333%2C34.8850511&key=API_KEY

https://maps.googleapis.com/maps/api/streetview/metadata?location=30.7451333%2C34.8850511&key=API_KEY

This request returns the following response

此请求返回以下响应

{
    "copyright":"© 2017 Google",
    "date":"2015-05",
    "location":{
        "lat":30.74513326023706,
        "lng":34.88505109084099
    },
    "pano_id":"Ig2uuF7itfCs8ksgjlJaTQ",
    "status":"OK"
 }

Now you have a panorama ID Ig2uuF7itfCs8ksgjlJaTQ. Let use it with Street View API:

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

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

Hope it helps!

希望它可以帮助!

#1


1  

The URL that you use to get panorama IDs is undocumented feature. The Terms of Service of Google Maps prohibits access to service via such URLs. Have a look at paragraph 10.1 (a) of ToS.

用于获取全景图id的URL是无文档说明的特性。谷歌映射的服务条款禁止通过此类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).

不能访问api或内容,除非通过服务。除非通过服务,否则您不会访问Maps API或内容。例如,除了Maps API之外,您不能通过接口或通道(包括未文档化的谷歌接口)访问地图块或图像。

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

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

You should use the API which is Street View Image Metadata in your case.

在您的案例中,应该使用的API是Street View图像元数据。

For example to get panorama ID for 30.7451333,34.8850511 you can execute the following query

例如,要获得307451333、34.8850511的全景ID,您可以执行以下查询。

https://maps.googleapis.com/maps/api/streetview/metadata?location=30.7451333%2C34.8850511&key=API_KEY

https://maps.googleapis.com/maps/api/streetview/metadata?location=30.7451333%2C34.8850511&key=API_KEY

This request returns the following response

此请求返回以下响应

{
    "copyright":"© 2017 Google",
    "date":"2015-05",
    "location":{
        "lat":30.74513326023706,
        "lng":34.88505109084099
    },
    "pano_id":"Ig2uuF7itfCs8ksgjlJaTQ",
    "status":"OK"
 }

Now you have a panorama ID Ig2uuF7itfCs8ksgjlJaTQ. Let use it with Street View API:

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

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

Hope it helps!

希望它可以帮助!