NAME

Geo::Coder::PlaceFinder - Geocode addresses with Yahoo PlaceFinder

SYNOPSIS

use Geo::Coder::PlaceFinder;

my $geocoder = Geo::Coder::PlaceFinder->new(appid => 'Your App ID');
my $location = $geocoder->geocode(
    location => 'Hollywood and Highland, Los Angeles, CA'
);

DESCRIPTION

The Geo::Coder::PlaceFinder module provides an interface to the Yahoo PlaceFinder geocoding service.

METHODS

new

$geocoder = Geo::Coder::PlaceFinder->new(appid => 'Your App ID')

Creates a new geocoding object.

A Yahoo API Key can be obtained here: https://developer.apps.yahoo.com/dashboard/createKey.html

Accepts an optional ua parameter for passing in a custom LWP::UserAgent object.

geocode

$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 location results.

Each location result is a hashref; a typical example looks like:

{
    areacode     => 213,
    city         => "Los Angeles",
    country      => "United States",
    countrycode  => "US",
    county       => "Los Angeles County",
    countycode   => "",
    cross        => "",
    hash         => "",
    house        => "",
    latitude     => "34.101559",
    line1        => "Hollywood and Highland",
    line2        => "Los Angeles, CA  90028",
    line3        => "",
    line4        => "United States",
    longitude    => "-118.339073",
    name         => "Hollywood and Highland",
    neighborhood => "",
    offsetlat    => "34.101559",
    offsetlon    => "-118.339073",
    postal       => 90028,
    quality      => 90,
    radius       => 100,
    state        => "California",
    statecode    => "CA",
    street       => "",
    timezone     => "America/Los_Angeles",
    unit         => "",
    unittype     => "",
    uzip         => 90028,
    woeid        => 23529720,
    woetype      => 20,
    xstreet      => "",
}

response

$response = $geocoder->response()

Returns an HTTP::Response object for the last submitted request. Can be used to determine the details of an error.

ua

$ua = $geocoder->ua()
$ua = $geocoder->ua($ua)

Accessor for the UserAgent object.

SEE ALSO

http://developer.yahoo.com/geo/placefinder/

Geo::Coder::Bing, Geo::Coder::Bing::Bulk, Geo::Coder::Google, Geo::Coder::Mapquest, Geo::Coder::Multimap, Geo::Coder::Navteq, Geo::Coder::OSM, Geo::Coder::TomTom, Geo::Coder::Yahoo

REQUESTS AND BUGS

Please report any bugs or feature requests to http://rt.cpan.org/Public/Bug/Report.html?Queue=Geo-Coder-PlaceFinder. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Geo::Coder::PlaceFinder

You can also look for information at:

COPYRIGHT AND LICENSE

Copyright (C) 2010 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.

AUTHOR

gray, <gray at cpan.org>