【问题标题】:Google geocode API returning wrong/empty values for Luxembourg zipcodes谷歌地理编码 API 返回卢森堡邮政编码的错误/空值
【发布时间】:2017-03-24 19:57:37
【问题描述】:

我正在对 L-4321、L-8287 等拉链进行 API 调用。

这里是网址。

https://maps.googleapis.com/maps/api/geocode/json?address=4321%2CLU
https://maps.googleapis.com/maps/api/geocode/json?address=postal_code%3A4321%7Ccountry%3ALU
https://maps.googleapis.com/maps/api/geocode/json?address=8287%2CLU

他们正在返回美国某些地方的结果。请帮忙!

【问题讨论】:

    标签: google-maps google-maps-api-3 geolocation geocoding


    【解决方案1】:

    “返回空字符串”响应不是预期行为。似乎错误在于您如何处理响应。如果您直接在浏览器上使用该请求,它至少应该返回一个error,如果它没有返回一个位置。

    【讨论】:

      【解决方案2】:

      只是缺少那些邮政编码。

      在您尝试的 3 个请求中,只有这个是正确的:

      https://maps.googleapis.com/maps/api/geocode/json?address=postal_code%3A4321%7Ccountry%3ALU

      它返回 ZERO_RESULTS 因为没有匹配的结果。

      其他 2 个请求查找与 4 位数字加上以“lu”开头的内容(Luverne、Luz 等)匹配的结果 ─ 如果没有 components=country:LU 过滤器,则无法保证结果会是在卢森堡。

      这是一个在卢森堡找到邮政编码的请求:

      https://maps.googleapis.com/maps/api/geocode/json?address=postal_code%3A1717%7Ccountry%3ALU

      可以在 Google 地图中报告缺少的邮政编码: https://support.google.com/maps/answer/3094088?co=GENIE.Platform%3DDesktop&hl=en

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-01-24
        • 1970-01-01
        • 2018-08-24
        • 1970-01-01
        相关资源
        最近更新 更多