在使用地址解析器发出一个请求后获取查询限制 [英] Getting OVER QUERY LIMIT after one request with geocode

查看:215
本文介绍了在使用地址解析器发出一个请求后获取查询限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ggmap的地理编码查找不同城市的经纬度。它昨天工作完全正常,但在今天只有一个请求后,我得到了OVER QUERY LIMIT。



事实上,如果我只是加载库并运行geocode,它会抛出OVER QUERY LIMIT错误:

 >库(ggmap)
> geocode(Paris)
来自网址的信息:http://maps.googleapis.com/maps/api/geocode/json?address=Paris&sensor=false
lon lat
1 NA NA
警告消息:
地理编码失败,状态为OVER_QUERY_LIMIT,位置=Paris

我在stackoverflow上检查了不同的主题,但似乎没有人遇到同样的问题。
我试图看看我是否超过了2500的限制(非常不可能,但我是新手编码,所以也许我做了错误的事情......)和geocodeQueryCheck()读取2498,但是每次运行时它都会重置库(ggmap)。

它在15分钟前运行,当我重新启动Rstudio但现在不再工作,我完全丢失了!



有没有人知道可能是什么问题?



PS:我是新手,因此如果您有任何评论在任何情况下,请告诉我!

解决方案

我有类似的问题使用 ggmap :: geocode / code>,即使 geocodeQueryCheck()会显示足够多的地理编码查询,但仍有大约20%的地点发出OVER QUERY LIMIT错误,而且错误零星地散布在各地,而不仅仅是最后的20%。如果我重新搜索第一次失败的位置的子集,则大多数都可以工作,所以我必须遍历较小的子集,直到它们都具有地理编码。

ggmap v2.7允许用户通过 register_google()函数指定Google Maps API密钥。 v2.7还没有在CRAN上,所以你必须使用 devtools :: install_github(dkahle / ggmap)来安装它。在更新到该版本并设置我的API密钥 register_google(key =my_api_key)后,同一批次在一次运行中按预期工作。



Google Maps API密钥很容易获得:
https://developers.google.com/maps/documentation/geocoding/get-api-key


I'm using the ggmap's geocode to find the latitude and longitude of different cities. It worked completely fine yesterday but I get an OVER QUERY LIMIT after only one request today.

In fact if I just load the library and run geocode it throws the OVER QUERY LIMIT error:

> library(ggmap)
> geocode("Paris")
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Paris&sensor=false
  lon lat
1  NA  NA
Warning message:
geocode failed with status OVER_QUERY_LIMIT, location = "Paris" 

I checked different topics on stackoverflow but nobody seems to have the same problem. I tried to see if I was over the 2500 limit (very unlikely but I'm new to coding so maybe I did something wrong...) and geocodeQueryCheck() reads 2498 but then again it resets every time I run library(ggmap).

It worked once fifteen minutes ago when I rebooted Rstudio but now it doesn't work anymore, I'm completely lost!

Does anyone have any idea what might be the problem?

PS: I'm new to stackoverflow so if you have any remark on anything please tell me!

解决方案

I had a similar problem using ggmap::geocode() for a batch of locations where roughly 20% of locations gave the OVER QUERY LIMIT error even though geocodeQueryCheck() would show more than enough geocoding queries remaining, and the errors were sporadically spread throughout the locations, not just the last 20%. If I reran the subset of locations that failed the first time, again most would work, so I had to iterate through smaller subsets until they all had geocodes.

ggmap v2.7 allows the user to specify a Google Maps API key through the register_google() function. v2.7 is not on CRAN yet, so you have to use devtools::install_github("dkahle/ggmap") to install it. After updating to that version and setting my API Key register_google(key = "my_api_key"), the same batch worked in one run as expected.

The Google Maps API Key is easy to get: https://developers.google.com/maps/documentation/geocoding/get-api-key

这篇关于在使用地址解析器发出一个请求后获取查询限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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