|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
How to make Geo::Coder::Google run even if input location doesn't existby M15U (Acolyte) |
| on Mar 01, 2013 at 07:58 UTC ( #1021176=perlquestion: print w/ replies, xml ) | Need Help?? |
|
M15U has asked for the
wisdom of the Perl Monks concerning the following question:
Hello monks, I have a question for you. I'm trying to use Geo::Coder::Google to get a list of coordinates from an array of locations. My problem is that the array of locations is generated by an another script which sometimes puts in it some strange locations which can not be found in google maps, i.e. "CorseMétéo". This generates the following error message : "Google Maps API returned error: 500 Can't connect to maps.google.com:80 (Bad hostname) at geoTest.pl line 24.". My code looks like this:
It is true that Geo::Coder::Google is design to run on streed adress. However it seems to work fine on any other location, if it exist. I've try using the "eval" or "$@" error cheking on the the module object "$geocoder->geocode(location => $place)", but it runs in conflict with "@{ $response->{Point}{coordinates}"giving me the following error message : "Can't use an undefined value as an ARRAY reference at geoTest.pl line 31.". Hope I was clear enough in problem explanation Thank you Monks !!!
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||