且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

正确的地址格式可以从Google GeoCoding API中获得最准确的结果

更新时间:2023-02-26 17:29:13

我相信建议的格式是:

 房屋号码,街道方向,街道名称,Street Suffix,City,State,Zip,Country 

在您的示例中,地理编码器正在搜索名为布鲁姆的街道,其中在OH而不是CT中存在类似的匹配。从查询中删除'bloom',然后搜索返回Bloomfield,CT。


Is there any standard format to supply the address string to Google GeoCoding API to get the most accurate results on map.

For Eg. following query not giving correct result.

http://maps.googleapis.com/maps/api/geocode/xml?address=bloom,Bloomfield,CT,06002,USA&sensor=false

Thanks

Mandeep

I believe the suggested format is:

House Number, Street Direction, Street Name, Street Suffix, City, State, Zip, Country

The results get less specific the less information you can supply, obviously.

In your sample, the geocoder is searching for a street named 'bloom', of which there are similar matches in OH instead of CT. Removing 'bloom' from the query and then searching returns Bloomfield, CT.