Closed dknykrisztina closed 4 years ago
I can't reproduce your error
library(googleway)
# key <- "my_key"
df <- google_geocode(address = "5 Rue J-F Kennedy 8332 Luxembourg", key = key, simplify = TRUE)
df$results$geometry$location
# lat lng
# 1 49.62014 6.146283
df$results$address_components
# [[1]]
# long_name short_name types
# 1 5 5 street_number
# 2 Avenue John F. Kennedy Avenue John F. Kennedy route
# 3 Luxembourg Luxembourg locality, political
# 4 Luxembourg Luxembourg administrative_area_level_2, political
# 5 District de Luxembourg District de Luxembourg administrative_area_level_1, political
# 6 Luxembourg LU country, political
# 7 1229 1229 postal_code
Are you behind a firewall, or on a company or uni network?
Yes, I´m working from a company server. Maybe the problem is in the proxy settings?
yeah - see these similar issues
@dknykrisztina did any of those links solve your issue?
I have this problem also. It is not reproducible - the next attempt works. I am not using a proxy.
@jzadra
the next attempt works
The next attempt on the same address, or a different address?
Same address.
This is really hard to debug without a reproducible example. The fact it works sometimes for you suggests to me it's not an issue with googleway
. Have you searched for similar issues when using the geocoding API direct from Google?
It can be that the real address line you send to Google from R contains some invalid letters/characters, e.g. some French letters. Check the address for any symbols not contained in UTF-8 using this function: validUTF8(yorstring) If the result is "FALSE", replace invalid characters e.g. using gsub. To see which characters are invalid, use something like this: iconv(yorstring, "UTF-8", "UTF-8",sub="")
It can be that the real address line you send to Google from R contains some invalid letters/characters, e.g. some French letters. Check the address for any symbols not contained in UTF-8 using this function: validUTF8(yorstring) If the result is "FALSE", replace invalid characters e.g. using gsub. To see which characters are invalid, use something like this: iconv(yorstring, "UTF-8", "UTF-8",sub="")
It works! I just try to change my address to UTF-8 by enc2utf8()
.
Thank you very much❤️❤️
(BTW I used an address from Taiwan in Traditional Chinese, hope the info could be helpful. )
Hy, I´d tested this simple, short code before I get it through the whole address list, but it had got en error.
Script: library(googleway) key <- "my_key" df <- google_geocode(address = "5 Rue J-F Kennedy 8332 Luxembourg", key = key, simplify = TRUE)
Error in value[3L] : There was an error downloading results. Please manually check the following URL is valid by entering it into a browswer. If valid, please file a bug report citing this URL: https://maps.googleapis.com/maps/api/geocode/json?&address=5+rue+j-f+kennedy+8332+luxembourg&key=
I tested in Firefox and Internet Explorer with the URL, and it was fine: { "results" : [ { "address_components" : [ { "long_name" : "5", "short_name" : "5", "types" : [ "street_number" ] }, { "long_name" : "Rue J-F Kennedy", "short_name" : "Rue J-F Kennedy", "types" : [ "route" ] }, { "long_name" : "Olm", "short_name" : "Olm", "types" : [ "locality", "political" ] }, { "long_name" : "Capellen", "short_name" : "Capellen", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "District de Luxembourg", "short_name" : "District de Luxembourg", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "Luxembourg", "short_name" : "LU", "types" : [ "country", "political" ] }, { "long_name" : "8332", "short_name" : "8332", "types" : [ "postal_code" ] } ], "formatted_address" : "5 Rue J-F Kennedy, 8332 Olm, Luxembourg", "geometry" : { "location" : { "lat" : 49.6480276, "lng" : 5.9942782 }, "location_type" : "ROOFTOP", "viewport" : { "northeast" : { "lat" : 49.6493765802915, "lng" : 5.995627180291502 }, "southwest" : { "lat" : 49.6466786197085, "lng" : 5.992929219708498 } } }, "place_id" : "ChIJkR_lV8VMlUcRSUmeVhgUxV0", "plus_code" : { "compound_code" : "JXXV+6P Mamer, Luxembourg", "global_code" : "8FX7JXXV+6P" }, "types" : [ "street_address" ] } ], "status" : "OK" }
If somebody can help my, I´d appriciate it. Thnx, Krisztina