google geocoding api not as accurate as google maps using address

我的未来我决定 提交于 2019-12-06 01:59:56

问题


I have many examples where google maps returns the exact location whereas geocoding cannot find an exact match and provides only a close match lat/lon which is no good for my purpose.

example: "1729 state road 8, auburn, IN 46706" in google maps drops me exactly on a walmart distribution center as it should.

using geocoding.....either thru http://gmaps-samples.googlecode.com/svn/trunk/geocoder/singlegeocode.html

or manually

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

has the location several miles away...

I don't understand why the difference as I would expact MAPs to use geocoding etc, and many many examples don't match up between the two. I need to get geocoding via MAPS !


回答1:


After reading through lot of answers i came across this solution that Gecoder is used to find the nearest postal addresses.To get Local Business Data use Google Places API

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

it can be done like this

https://maps.googleapis.com/maps/api/place/textsearch/json?query=someplacename&key=key


来源:https://stackoverflow.com/questions/34159076/google-geocoding-api-not-as-accurate-as-google-maps-using-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!