本文介绍了Google地图API:地理编码会返回不同的坐标,然后返回Google地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试对地址进行地理编码,但我在获取准确的坐标时遇到了问题。例如,如果我在谷歌地图中输入地址,它会正确显示,但如果我对相同地址进行地理编码,则只会从地理编码json响应以及不同的坐标中获取APPROXIMATE位置类型。



是什么导致了这种差异,有什么我可以做的,以提高我的地理编码的准确性,以达到手动谷歌地图地址搜索的水平?

解决方案

尝试将国家添加到查询中。在都柏林Lucan的Fonthill Road,它给出了不同尺寸的结果:



注意:我使用都柏林Lucan的Fonthill路。因此,将该区域置于查询中会使响应的大小发生巨大差异。
地理编码-6.4059442,53.3473048非常接近Lucan公司Fonthill Retail Park 1号单元。都柏林。



我的结论是您需要比较姓名和地址,因为您查询的结果是:



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

在我的例子中,我使用Fonthill Road的地址...,结果给出了:

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

完全一样,地理编码也显示正确的位置,但我不确定如果这个地区如此重要,那可能是我错了,但我认为如果你想提高你的准确性,你需要循环回应 -



你有没有阅读:?


I am currently attempting to geocode addresses but I'm having an issue with getting accurate co-ordinates. For example if I enter the address into google maps it shows up correctly, but if I geocode the same address I only get an APPROXIMATE location type from the geocode json response as well as different co-ordinates.

What is causing the discrepancy and is there anything I can do to improve the accuracy of my geocoding to get to the level of a manual google maps address search?

解决方案

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?

这篇关于Google地图API:地理编码会返回不同的坐标,然后返回Google地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 04:16