我剛剛遇到同樣的問題,並找到您的帖子。我能夠通過將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個請求,以供非業務使用。 –