gpt4 book ai didi

javascript - 谷歌地图API : can I get the best auto suggest and geocode it?

转载 作者:行者123 更新时间:2023-11-28 10:09:34 24 4
gpt4 key购买 nike

我有一堆地址(字符串)。我尝试用 GoogleMaps 搜索它们,但很多都没有直接找到。然而,“您的意思是……”中的第一个结果在大多数情况下都是准确的。

如果 Google API 无法对我的原始地址进行地理编码,有没有办法通过 JS 或 C# 代码获取第一个“您是说”并对其进行地理编码吗?

我有一个相应的固定电话列表。我可以对它们或每个的第一个“您是说”结果进行地理编码吗?

干杯

最佳答案

In case of Google API cannot geocode my original address, is there any way to fetch the first "did you mean" via JS or C# code and geoCode it?

要回答您问题的这一部分,是的,您可以。当您调用 Google 的地理编码 API 时,它会返回一个 JSON 数组结果。该数组中的结果按准确性顺序排列。

此元素的属性之一是 partial_match

partial_match indicates that the geocoder did not return an exact match for the original request, though it did match part of the requested address. You may wish to examine the original request for misspellings and/or an incomplete address. Partial matches most often occur for street addresses that do not exist within the locality you pass in the request.

此时,您知道可能需要仔细检查您传入的字符串,但除此之外,Google 可能会很好地找到与您提供的内容相关的地址,您可以选择以最佳方式解析 JSON 响应(选择非常准确或非常广泛)。

关于javascript - 谷歌地图API : can I get the best auto suggest and geocode it?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7654071/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com