Dear all,

I'm trying to geocode addresses (of Catalonia) with accents and
Catalan characters (as for example "ç").  I'm using the "geocode"
function (package ggmap), but I obtain some Google "INVALID_REQUEST"
when the addresses have these characters. For example:

> geocode("Carrer Veneçuela, 10, 08019 Barcelona, Spain")
Information from URL :
http://maps.googleapis.com/maps/api/geocode/json?address=Carrer+Vene%E7uela,+10,+08019+Barcelona,+Spain&sensor=false
  lon lat
1  NA  NA
Warning message:
geocode failed with status INVALID_REQUEST, location =
"Carrer+Veneçuela,+10,+08019+Barcelona,+Spain"


> geocode("Carrer Mecànica, 12, 08038 Barcelona, Spain")
Information from URL :
http://maps.googleapis.com/maps/api/geocode/json?address=Carrer+Mec%E0nica,+12,+08038+Barcelona,+Spain&sensor=false
  lon lat
1  NA  NA
Warning message:
geocode failed with status INVALID_REQUEST, location =
"Carrer+Mecànica,+12,+08038+Barcelona,+Spain"

However, I can find these addresses directly on Google maps.

https://www.google.es/maps/place/Carrer+de+Vene%C3%A7uela,+10,+08019+Barcelona/@41.40873,2.2057253,17z/data=!3m1!4b1!4m2!3m1!1s0x12a4a347b9b9bb8d:0x41b696acd7b26e37

https://www.google.es/maps/place/Carrer+de+la+Mec%C3%A0nica,+12,+08038+Barcelona/@41.3591918,2.1379927,17z/data=!3m1!4b1!4m2!3m1!1s0x12a498a25156dc8b:0xc9ccfd74e54c503f


I think that there is a problem enconding the URL. I hope anyone can
help me! Thank you very much!


Marc

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to