Google地图地理编码api返回无效邮政编码的结果

问题描述 投票:-1回答:1

Google地理编码api返回以下邮政编码的结果:“ 0”,“ 00”,“ 000”,“ 00000”]

点击此api后-https://maps.googleapis.com/maps/api/geocode/json?address=00000&key=mysecretkey它返回“ formatted_address”:“ 6009 Wayzata Blvd Suite#108,St。Louis Park,MN 55416,美国”

这些有效的邮政编码吗?理想情况下,它不应返回结果。

google-maps google-geocoding-api zipcode
1个回答
0
投票

您应该注意几件事:

  • 当您在地址解析API请求中发送address=00000参数时,它将搜索格式地址或地名中的匹配项。在这种情况下,服务将不匹配邮政编码。

  • Google的数据库中可能有不良数据,可能导致意外结果。

在您的示例中,它似乎是Google数据库中的错误数据。

让我们来看看您的请求的回复

https://maps.googleapis.com/maps/api/geocode/json?address=00000&key=YOUR_API_KEY

您可以在响应中看到,地点ID为“ ChIJgyA2iZU0s1IReyHBw0yPjZg”。现在,检查此地点ID的地点详细信息请求的输出

https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJgyA2iZU0s1IReyHBw0yPjZg&key=YOUR_API_KEY

响应将包含以下内容

{
    ....
    id: "3fff72184719b7835304f285f40e677e9914933e",
    international_phone_number: "+1 763-300-8722",
    name: "00000",
    place_id: "ChIJgyA2iZU0s1IReyHBw0yPjZg",
    formatted_address: "6009 Wayzata Blvd Suite #108, St Louis Park, MN 55416, USA",
    types: [
        "lodging",
        "point_of_interest",
        "establishment"
    ],
    .....
} 

请注意,该商家在Google数据库中的名称为“ 00000”,因此Geocoding API可以正常工作,但是显然这里存在数据问题。

您可以使用此链接查看地点并向Google报告不良数据

https://maps.google.com/?cid=10992599825345749371

我希望这会有所帮助!

© www.soinside.com 2019 - 2024. All rights reserved.