I have to geocode few addresses in R but getting a "Timeout was reached: Connection timed out after 10000 milliseconds" error. I am behind office firewall so tried to use proxy as well but still getting the same error.
This works when I use source as "dsk" but it doesn't geocode most of the addresses hence want to use "google" as source.
Below is the piece of code that I used.
library(ggmap)
library(curl)
register_google(key = "Have_Entered_My_API_Key_Here")
#Used below code to use proxy...(saw it as a solution in stackoverflow only for working behind firewall..maybe I'm not doing it the correct way?)
library(httr)
set_config(use_proxy(url="10.3.100.207",port=8080))
origAddress <- read.csv("Data_for_Geocoding.csv",header = TRUE,sep = ",",stringsAsFactors = FALSE)
for(i in 1:nrow(origAddress))
{
result <- geocode(origAddress$Add_to_GeoCode[i], output = "latlona", source = "google",sensor = TRUE)
origAddress$LONGITUDE[i] <- as.numeric(result[1])
origAddress$LATITUDE[i] <- as.numeric(result[2])
# origAddress$ <- as.character(result[3])
}
I get the below error when I run this code.
"Error in curl::curl_fetch_memory(url, handle = handle) :
Timeout was reached: Connection timed out after 10000 milliseconds"
I have thousands of addresses that I need to geocode so will really appreciate if someone can help here.