我刚刚遇到同样的问题,并找到您的帖子。我能够通过将client
和signature
值设置为虚拟值来解决此问题,例如,
geocode(myLocations, client = "123", signature = "123", output = 'latlon', source = 'dsk')
这个问题似乎是与地理编码这部分功能...
if (length(location) > 1) {
if (userType == "free") {
limit <- "2500"
}
else if (userType == "business") {
limit <- "100000"
}
s <- paste("google restricts requests to", limit, "requests a day for non-business use.")
if (length(location) > as.numeric(limit))
stop(s, call. = F)
userType
在这部分代码上面设置...
if (client != "" && signature != "") {
if (substr(client, 1, 4) != "gme-")
client <- paste("gme-", client, sep = "")
userType <- "business"
}
else if (client == "" && signature != "") {
stop("if signature argument is specified, client must be as well.",
call. = FALSE)
}
else if (client != "" && signature == "") {
stop("if client argument is specified, signature must be as well.",
call. = FALSE)
}
else {
userType <- "free"
}
所以,如果client
和signature
参数为空,则将userType
设置为“空闲”,然后将限制设置为2,500。通过提供这些参数的值,您被视为具有100,000个限制的“商业”用户。如果用户被假定为使用'Google'而不是'dsk'作为源,但是如果源是'dsk'并且应该可能被覆盖,这是一个很好的检查。要头脑简单,也许像...
if (source == "google") {
if (client != "" && signature != "") {
if (substr(client, 1, 4) != "gme-")
client <- paste("gme-", client, sep = "")
userType <- "business"
}
else if (client == "" && signature != "") {
stop("if signature argument is specified, client must be as well.",
call. = FALSE)
}
else if (client != "" && signature == "") {
stop("if client argument is specified, signature must be as well.",
call. = FALSE)
}
else {
userType <- "free"
}
} else {
userType <- "business"
}
这会造成问题,如果client
或signature
参数计划在其它来源虽然。我会ping包装作者。
谢谢!它有些作品,但仍然有限。原因是尽管使用虚拟值跳过了2500的限制,但现在它停止在商业Google的限制,即10,000:错误:谷歌将请求限制为每天100000个请求,以供非业务使用。 –