【问题标题】:Google Distance Api returns Zero with specific Latitude LongitudeGoogle Distance Api 返回具有特定纬度经度的零
【发布时间】:2014-01-15 08:02:50
【问题描述】:

我正在向 Google API 提供起点纬度/经度和目的地纬度/经度。

但作为响应,它返回零。

提供的坐标:

Origin       = 70.7417,-22.6583 

Destination  = 48.8602,2.34107 

输出结果:

This XML file does not appear to have any style information associated with it. 
The document tree is shown below.

    <DirectionsResponse>
    <status>ZERO_RESULTS</status>
    </DirectionsResponse>

来源链接:

https://maps.google.com/maps/api/directions/xml?language=fr&origin=70.7417,-22.6583&destination=48.8602,2.34107&sensor=false

谁能告诉我哪里出错了?

最初的点是丹麦 |皮恩特警员 | 3985 | Gronland TO France Paris 75001 Ile-de-France

【问题讨论】:

  • 没错,方向服务没有包括您需要乘船或飞机旅行的路线(部分渡轮除外)。只要没有人建造从格陵兰到欧亚大陆的桥梁,你就不会得到从格陵兰到巴黎的方向的结果。

标签: php google-maps


【解决方案1】:

“ZERO_RESULTS”表示地理编码成功但未返回任何结果。如果向地理编码传递了不存在的地址或远程位置的 latlng,则可能会发生这种情况。

请尝试检查您的坐标是否有效。

【讨论】:

  • 是的,但是 48.8602,2.34107 在巴黎,70.7417,-22.6583 在格陵兰岛,坐标是有效的,但从那 2 点开始无法获得方向
  • 正如我所提到的,最初的点是来自 Danemark,Constable Pynt TO France Paris 75001 Ile-de-France。
  • 坐标有效。警员 Pynt 3985 位于丹麦的格林德兰(在丹麦王国内拥有自治权)。还有Google Maps 报告我们无法计算 48.860200、2.341070 和 70.741700、-22.658300 之间的方向。。请参阅 Molle 博士的评论。
【解决方案2】:

我的猜测是 Google 地图会尝试在两点之间找到一条行车路线。由于您提供的地点在格陵兰和法国,没有直接联系,谷歌无法找到路线,因此回复ZERO_RESULTS

引用自documentation

ZERO_RESULTS indicates no route could be found between the origin and destination.

【讨论】:

  • 原来的点是来自丹麦 |皮恩特警员 | 3985 | Gronland TO France Paris 75001 Ile-de-France
猜你喜欢
  • 2011-03-11
  • 1970-01-01
  • 1970-01-01
  • 2014-08-25
  • 1970-01-01
  • 2021-10-10
  • 2016-09-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多