用googleway对地址进行地理编码:结果不一致 [英] Geocoding addresses with googleway: incoherent results

查看:109
本文介绍了用googleway对地址进行地理编码:结果不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用R中的googleway软件包中的google_geocode函数对Google Maps上的地址进行地理编码.我正在使用从Google获得的密钥,该密钥可使我超过2500/天的限制(并为此收取费用).我有不同类型的问题,主要是由于我使用的地址的写入方式所致,但是在这里我想问一个问题:使用googe_geocode查询有时我没有结果,但是如果我键入 http://www.google.com/maps/上的相同地址字符串会返回一个结果?

I am trying to geocode addresses on Google Maps using the google_geocode function from the package googleway in R. I am using a key obtained from Google that allows me to go over the 2500/day limit (and being charged for that). I have different types of problems, mainly due to the way the addresses I use are written, but there is one issue that I would like to ask here: how is it possible that I sometimes get no results querying with googe_geocode, but if I type the same address string on http://www.google.com/maps/ it does return a result?

我的例子:

address="AVENDAÑO, 30-32 VITORIA-GASTEIZ 01008, ES"
# the address I want to geocode. Its format is "street, number, city postcode, country" in a single string.
google_geocode(address=address,key=mykey) # I write the right key as mykey.
# I get no results:
$results
list()
$status
[1] "ZERO_RESULTS"

但是,如果在Google地图中搜索完全相同的地址字符串,我会找到正确的位置(表明这是西班牙维多利亚的AbendañoKalea):

But, if search for exactly the same address string in Google Maps, I get the right location (showing that this is Abendaño Kalea in Vitoria, Spain):

任何人都可以解释发生了什么事吗?也许Google Maps或Google Geocoding API的某些人员可能会有所帮助? 非常感谢,

Can anyone explain what may be going on? Maybe some staff from Google Maps or Google Geocoding API may help? Thanks a lot,

推荐答案

我认为这很可能是由于编码问题所致.尝试使用Ñ"定位地址时,发生了这种情况.这样做对我有用:

I think it is likely that is due to encoding issues. I have had this happen when trying to geolocate addresses with "Ñ". Doing this worked for me:

string <- "AVENDAÑO, 30-32 VITORIA-GASTEIZ 01008, ES"
Encoding(string) <- "UTF-8"
google_geocode(string, key = key)

自从Google更改了其定价方案以来,您现在需要一个API密钥.

Since google changed their pricing scheme now you need to have an API key.

这篇关于用googleway对地址进行地理编码:结果不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆