google地理编码api不如使用地址的google地图准确

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

[我有很多示例,其中Google地图返回确切位置,而地理编码找不到精确匹配项,仅提供近似匹配纬度/经度,对我的目的不利。

例如:Google地图中的“ 1729国道8号,奥本,印第安纳州46706”将我准确地按需放置在沃尔玛配送中心。

使用地理编码.....直到http://gmaps-samples.googlecode.com/svn/trunk/geocoder/singlegeocode.html

或手动

通过https://maps.googleapis.com/maps/api/geocode/json?address=1729+state+road+8,+auburn,+IN,+46706&key=[your_key_here]

位置在几英里外...

我不明白为什么会有所不同,因为我会精确解释使用地理编码等的MAP,而且许多示例在两者之间不匹配。我需要通过MAPS进行地理编码!

google-maps google-maps-api-3 geocoding google-geocoding-api
1个回答
2
投票

阅读了很多答案之后,我发现此解决方案使用Gecoder来查找最近的邮政地址。要使用Google Places API获取本地业务数据,

https://developers.google.com/places/web-service/search#PlaceSearchRequests

可以这样做

https://maps.googleapis.com/maps/api/place/textsearch/json?query=someplacename&key=key
© www.soinside.com 2019 - 2024. All rights reserved.