距离矩阵API:邮政编码70128返回零结果 [英] Distance Matrix API: Zip Code 70128 returns zero results

查看:121
本文介绍了距离矩阵API:邮政编码70128返回零结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个小问题。如果我搜索涉及地区代码70128的距离,如下所示:

https://maps.googleapis.com/maps/api/distancematrix/json?units = imperial& origins = 40.6782%2C-73.9442& destinations = new + orleans + LA + 70128



我得到一个ZERO_RESULTS状态。但是,如果我只进行相同的搜索,并且只将新奥尔良邮政编码更改为附近的邮政编码,就可以得到结果,如下所示:

/ maps.htm googleapis.com/maps/api/distancematrix/json?units=imperial&origins=40.6782%2C-73.9442&destinations=new+orleans+LA+70129



70128是新奥尔良的合法邮政编码,所以我应该得到结果。有趣的是,当我没有得到结果时,我的原始地址就像我给出的一样(以lat / lng坐标显示),但是当我得到结果时,它知道将它转换为地址。这可能会也可能不会提供线索。



我甚至已经提供了仅仅为来源和目的地提供类似结果的邮政编码。



我也可以将邮政编码70128替换为来源而不是目的地。它看起来像API不喜欢这个邮政编码出于某种原因,我不知道这是为什么。是否有人对此有所了解?



第一个网址的结果:

  destination_addresses:[
美国新奥尔良LA 70128

origin_addresses:[
40.6782,-73.9442
],
行:[
{
元素:[
{
status:ZERO_RESULTS
}
]
}
],
status:OK
}

结果第二个网址:

  {
destination_addresses:[
New Orleans,LA 70129,USA
],
origin_addresses:[
57美国纽约布鲁克林大西洋大道57号

行:[
{
元素:[
{
距离:{
文本:1,294英里,
值:2081879
},
持续时间:{
文本:19小时7分钟,
值:68835
},
状态:确定
}



status $ OK

$ b $ $ $ $ $ $ $ b

解决方案

看起来像 70128邮政编码地理位置在庞恰特雷恩湖中间。如果在那一点附近没有任何道路,行车路线将失败。



如果我将这一点转移到道路上(例如30.061671处的I-10, -89.936772),我得到结果


Here's a little puzzler. If I search for a distance involving area code 70128, like so:

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=40.6782%2C-73.9442&destinations=new+orleans+LA+70128

I get a ZERO_RESULTS status. But I do get results if I do the same search with only the New Orleans zip code changed to a nearby one, like so:

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=40.6782%2C-73.9442&destinations=new+orleans+LA+70129

70128 is a legitimate zip code for New Orleans, so I should get results. Interestingly, when I get no results my origin address is displayed just as I gave it (in lat/lng coordinates), but when I do get results it knows to convert it to an address. That may or may not provide a clue.

I've even gone so far as to merely provide a zip code for the origin and destination with similar results.

I can also swap zip code 70128 to an origin instead of a destination. It just seems like the API does not like this zip code for some reason, and I've no idea why that could be. Does anybody have some insight to this?

Result of first URL:

{
  destination_addresses: [
    "New Orleans, LA 70128, USA"
  ],
  origin_addresses: [
    "40.6782,-73.9442"
  ],
  rows: [
    {
      elements: [
      {
        status: "ZERO_RESULTS"
      }
      ]
    }
  ],
  status: "OK"
}

Result of second URL:

{
  destination_addresses: [
    "New Orleans, LA 70129, USA"
  ],
  origin_addresses: [
    "57 Atlantic Ave, Brooklyn, NY 11216, USA"
  ],
  rows: [
    {
        elements: [
        {
          distance: {
          text: "1,294 mi",
          value: 2081879
        },
        duration: {
          text: "19 hours 7 mins",
          value: 68835
        },
        status: "OK"
      }
    ]
  }
  ],
  status: "OK"
}

解决方案

Looks to me like the 70128 zip code is geolocated in the middle of Lake Pontchartrain. Driving directions will fail if there aren't any roads near that point.

If I take that point and move it to a road (say the I-10 at 30.061671,-89.936772), I get a result

这篇关于距离矩阵API:邮政编码70128返回零结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆