SymbolixAU / googleway

R Package for accessing and plotting Google Maps
http://symbolixau.github.io/googleway/
Other
234 stars 46 forks source link

Error in downloadData(map_url, simplify, curl_proxy) : Cannot retrieve results. No valid internet connection (tested using curl::has_internet #216

Open satyamedidi opened 4 years ago

satyamedidi commented 4 years ago

This happens when i use the google_places function

google_places(search_string = "Agence societe Generale, Paris 75015", key = key ,curl_proxy =curl_proxy("https://google.com"))

Error in downloadData(map_url, simplify, curl_proxy) : Can not retrieve results. No valid internet connection (tested using curl::has_internet

satyamedidi commented 4 years ago

Please help

SymbolixAU commented 4 years ago

what happens if you run curl::has_internet()?

jarekbryk commented 4 years ago

Hello,

I have the same issue with google_distance(), even though I am not behind any proxy. curl::has_internet() shows FALSE. The above solution doesn't work. Obviously my internet is working.

Help page for curl::has_internet() says it's performing a DNS lookup. When I do nslookup("www.r-project.org") it works - outputs an IP address. When I set the curl_proxy = curl_proxy("www.r-project.org") it doesn't work and says I am not connected to the internet. So where does curl_proxy gets its config from, as it appears not to be from the system config or nslookup? Is there a way of skipping this parameter completely so that the function does not check for internet connection and just uses system settings?

jarekbryk commented 4 years ago

I found a solution!

https://stackoverflow.com/questions/59796178/r-curlhas-internet-false-even-though-there-are-internet-connection

It's a cheat, but it works - you need to force set has_internet() to TRUE by running this:

assign("has_internet_via_proxy", TRUE, environment(curl::has_internet))