diff --git a/NEWS b/NEWS index 0467a5d..3927f9f 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() throws rate limit errors only when source is google (#150, + thanks @royalts) ggmap 2.6.1 diff --git a/R/geocode.R b/R/geocode.R index 27b7a01..5dca7fe 100644 --- a/R/geocode.R +++ b/R/geocode.R @@ -113,8 +113,10 @@ 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(source == 'google') { + 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 = " : ")) # geocode ply and out