diff --git a/NEWS b/NEWS index 0467a5d..ef5e893 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,8 @@ FIXES * README images moved from figures/ to tools/ * mutate_geocode() now works with tibbles (#68, thanks dannguyen) * get_stamenmap() now properly changes colors to black and white. +* geocode() now stops with a rate limiter error only when source = 'google' + (#150, thanks @phively) ggmap 2.6.1 diff --git a/R/geocode.R b/R/geocode.R index 27b7a01..bad4736 100644 --- a/R/geocode.R +++ b/R/geocode.R @@ -114,8 +114,8 @@ geocode <- function(location, output = c("latlon", "latlona", "more", "all"), # message/stop as neeeded s <- sprintf("google restricts requests to %s requests a day for non-premium use.", limit) - if(length(location) > as.numeric(limit)) stop(s, call. = FALSE) - if(length(location) > 200 && messaging) message(paste("Reminder", s, sep = " : ")) + if(length(location) > as.numeric(limit) && source == "google") stop(s, call. = FALSE) + if(length(location) > 200 && messaging && source == "google") message(paste("Reminder", s, sep = " : ")) # geocode ply and out if(output == "latlon" || output == "latlona" || output == "more"){