From 8354a79f2eb0afc8eb23d76c1e93950502d22b04 Mon Sep 17 00:00:00 2001 From: Paul Hively Date: Thu, 1 Mar 2018 12:36:37 -0600 Subject: [PATCH 1/2] Check source = google during vectorized geocoding Prevents the Google-specific messages and stop errors from displaying when attempting to geocode >2500 or >100000 addresses at once using a non-Google source. --- R/geocode.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"){ From d54fc56d44eec974caef63d42aee0d33bfd4f537 Mon Sep 17 00:00:00 2001 From: Paul Hively Date: Thu, 1 Mar 2018 14:19:38 -0600 Subject: [PATCH 2/2] Fix added to NEWS --- NEWS | 2 ++ 1 file changed, 2 insertions(+) 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