I use the Geo :: Coder :: Many perl module and get some weird results. When I install Google as a provider, the results are displayed correctly. However, setting the provider to Bing will change the latitude and longitude values. For instance:
use Geo::Coder::Google;
use Geo::Coder::Bing;
use Geo::Coder::Many;
use Geo::Coder::Many::Util qw( country_filter );
my $options = {
scheduler_type => 'WRR',
};
my $geocoder_many = Geo::Coder::Many->new( $options );
my $Locatorize = Geo::Coder::Google->new( apikey => 'yur Key' );
my $Locatorize_options = {
geocoder => $Locatorize,
daily_limit => 2500,
};
$geocoder_many->add_geocoder( $Locatorize_options );
my $result = $geocoder_many->geocode(
{
location => '1600 Amphitheatre Parkway Mountain View, CA 94043'
}
);
if (defined $result) {
print "Longitude: ", $result->{longitude}, "\n";
print "Latitude: ", $result->{latitude}, "\n";
}
else {
print "Failed to geocode!\n";
}
This will return (correct):
Longitude: -122.085099 Latitude: 37.422782
When I change the provider to Bing, everything goes wrong:
my $WhereIzIt = Geo::Coder::Bing->new( key => 'Yur key' );
my $WhereIzIt_options = {
geocoder => $WhereIzIt,
daily_limit => 4000,
};
$geocoder_many->add_geocoder( $WhereIzIt_options );
This returns:
Longitude: 37.423176 Latitude: -122.085962
Does Bing consistently return results back? How can I change this in a module?
source
share