Google Maps API: Geocode returns different co-ordinates then Google maps

谁说我不能喝 提交于 2019-11-29 11:19:24

Try adding the country to the query. With Fonthill Road, Lucan, Dublin it gives different size results:

  1. http://maps.google.com/maps/geo?q=Fonthill%20Road,Lucan,Dublin,Ie
  2. http://maps.google.com/maps/geo?q=Fonthill%20Road,Lucan,Dublin

Note: I use Fonthill Road, Lucan, Dublin. Thus putting the region to the query makes a huge difference in size of the response. The geocode -6.4059442, 53.3473048 is very close to Unit 1,Fonthill Retail Park,Lucan,Co. Dublin.

My conclusion is you need to compare name and address, because the result from your query is:

"name": "Fonthill Retail Park,Lucan,Co. Dublin,Ie", "address": "Lucan, Co. Dublin, Irland",

and thus there isn't a Fonthill Retail Park in Google so the reverse geocode is Lucan, Dublin and this is exactly what you find in the map!?!

In my example I use address Fonthill Road..., the result gives

"name": "Fonthill Road,Lucan,Dublin,Ie" and address: "address": "Fonthill Rd N, Dublin, Co. Dublin, Irland",

which is exactly the same and the geocode is also showing the correct location but I'm not sure if the region is so important, it's probably I'm wrong but I think you need to loop through the response if you want to improve your accuracy anyway??

Have you read: https://developers.google.com/maps/documentation/geocoding/index#RegionCodes?

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