开发者

Google Map API: can I get the best auto suggest and geocode it?

开发者 https://www.devze.com 2023-04-10 11:19 出处:网络
I have a banch of addresses (strings). I tried to seach them with GoogleMaps and many of them are not found directly.

I have a banch of addresses (strings). I tried to seach them with GoogleMaps and many of them are not found directly. However the first result in the "did you mean..." was accurate in most of the cases.

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?

I have a corisponding land-phones list. Can I geoCode the开发者_如何学Gom or the first "did you mean" result for each of them ?

Cheers


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?

To answer this part of your question, yes you can. When you call Google's Geocoding API, it will return to you a JSON Array of results. The results in this array are in order of accuracy.

One of the properties of this element is 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.

This is when you know you might need to double check the string you are passing in, but otherwise, Google probably did a pretty good job of finding an address that relates to what you gave it, and you can choose to parse the JSON response in the best way (choosing to be very accurate or very broad).

0

精彩评论

暂无评论...
验证码 换一张
取 消