Geo::Coder::Bing - Geocode addresses with the Bing Maps API
use Geo::Coder::Bing; my $geocoder = Geo::Coder::Bing->new; my $location = $geocoder->geocode( location => 'Hollywood and Highland, Los Angeles, CA' );
The Geo::Coder::Bing module provides an interface to the Bing Maps geocoding service, via the Ajax API.
Geo::Coder::Bing
$geocoder = Geo::Coder::Bing->new()
Creates a new geocoding object.
Accepts an optional ua parameter for passing in a custom LWP::UserAgent object.
$location = $geocoder->geocode(location => $location) @locations = $geocoder->geocode(location => $location)
In scalar context, this method returns the first location result; and in list context it returns all locations results.
Each location result is a hashref; a typical example looks like:
{ 'BestLocation' => { 'Precision' => 0, 'Coordinates' => { 'Longitude' => '-118.338669106725', 'Latitude' => '34.1015635823646' } }, 'Locations' => [ { 'Precision' => 0, 'Coordinates' => { 'Longitude' => '-118.338669106725', 'Latitude' => '34.1015635823646' } } ], 'CountryRegion' => 244, 'Address' => { 'PostalCode' => '90028', 'CountryRegion' => 'United States', 'AdminDistrict' => 'CA', 'FormattedAddress' => 'Hollywood Blvd & N Highland Ave, Los Angeles, CA 90028', 'Locality' => 'Los Angeles', 'AddressLine' => 'Hollywood Blvd & N Highland Ave', 'PostalTown' => '', 'District' => '' }, 'MatchCode' => 1, 'Type' => 155, 'Shape' => undef, 'BestView' => { 'Type' => 0, 'NorthEastCorner' => { 'Longitude' => '-118.323121333557', 'Latitude' => '34.1112203763297' }, 'SouthWestCorner' => { 'Longitude' => '-118.354216879894', 'Latitude' => '34.0919067883995' }, 'Center' => { 'Longitude' => '-118.338669106725', 'Latitude' => '34.1015641333754' } }, 'MatchConfidence' => 0, 'Name' => 'Hollywood Blvd & N Highland Ave, Los Angeles, CA 90028' }
If the location contains non-ASCII characters, ensure it is a Unicode- flagged string or consists of UTF-8 bytes.
$ua = $geocoder->ua() $ua = $geocoder->ua($ua)
Accessor for the UserAgent object.
http://www.microsoft.com/maps/isdk/ajax/
Geo::Coder::Google, Geo::Coder::Yahoo
Please report any bugs or feature requests to http://rt.cpan.org/Public/Bug/Report.html?Queue=Geo-Coder-Bing. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Geo::Coder::Bing
You can also look for information at:
GitHub Source Repository
http://github.com/gray/geo-coder-bing
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Geo-Coder-Bing
CPAN Ratings
http://cpanratings.perl.org/d/Geo-Coder-Bing
RT: CPAN's request tracker
http://rt.cpan.org/Public/Dist/Display.html?Name=Geo-Coder-Bing
Search CPAN
http://search.cpan.org/dist/Geo-Coder-Bing
Copyright (C) 2009 gray <gray at cpan.org>, all rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
gray, <gray at cpan.org>
To install Geo::Coder::Bing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Coder::Bing
CPAN shell
perl -MCPAN -e shell install Geo::Coder::Bing
For more information on module installation, please visit the detailed CPAN module installation guide.