GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GEO::CODER::PLACEFINDER (3)

.ds Aq ’

NAME

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

CONTENTS

SYNOPSIS



    use Geo::Coder::PlaceFinder;

    my $geocoder = Geo::Coder::PlaceFinder->new(appid => Your App ID);
    my $location = $geocoder->geocode(
        location => 701 First Ave, Sunnyvale, CA
    );



DESCRIPTION

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

METHODS

    new



   $geocoder = Geo::Coder::PlaceFinder->new(Your App ID)
   $geocoder = Geo::Coder::PlaceFinder->new(
       appid => Your App ID,
       # debug => 1,
   )



Creates a new geocoding object.

Accepts the following named arguments:
o appid

A Yahoo Application ID. (required)

An ID can be obtained here: <https://developer.apps.yahoo.com/dashboard/createKey.html>

o ua

A custom LWP::UserAgent object. (optional)

o compress

Enable compression. (default: 1, unless debug is enabled)

o debug

Enable debugging. This prints the headers and content for requests and responses. (default: 0)

    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.

Accepts the following named arguments:
o location

The free-form, single line address to be located. (optional)

o raw

Returns the raw data structure converted from the response, not split into location results.

Any additional arguments will added to the request. See the Yahoo PlaceFinder documention for the full list of accepted arguments.

By default the following arguments are added:
o flags

JRSTX

o gflags

AC

Example of the data structure representing a location result:



    {
        areacode    => 408,
        boundingbox => {
            east  => "-122.025092",
            north => "37.416275",
            south => "37.416275",
            west  => "-122.025092",
        },
        city        => "Sunnyvale",
        country     => "United States",
        countrycode => "US",
        county      => "Santa Clara County",
        countycode  => "",
        cross =>
            "Near the intersection of 1st Ave and N Mathilda Ave/Bordeaux Dr",
        hash         => "DDAD1896CC0CDC41",
        house        => 701,
        latitude     => "37.416275",
        line1        => "701 1st Ave",
        line2        => "Sunnyvale, CA  94089-1019",
        line3        => "",
        line4        => "United States",
        longitude    => "-122.025092",
        name         => "",
        neighborhood => "",
        offsetlat    => "37.416397",
        offsetlon    => "-122.025055",
        postal       => "94089-1019",
        quality      => 87,
        radius       => 500,
        state        => "California",
        statecode    => "CA",
        street       => {
            stbody   => "1ST",
            stfull   => "1st Ave",
            stpredir => undef,
            stprefix => undef,
            stsufdir => undef,
            stsuffix => "AVE",
        },
        timezone => "America/Los_Angeles",
        unit     => "",
        unittype => "",
        uzip     => 94089,
        woeid    => 12797150,
        woetype  => 11,
        xstreet  => "",
    }



Example of the data structure returned using the raw option:



    ResultSet => {
        Error        => 0,
        ErrorMessage => "No error",
        Found        => 1,
        Locale       => "us_US",
        Quality      => 60,
        Results      => [ $location ]
        version      => "1.0",
    }



    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/>

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:
o GitHub Source Repository

<http://github.com/gray/geo-coder-placefinder>

o AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/Geo-Coder-PlaceFinder>

o CPAN Ratings

<http://cpanratings.perl.org/d/Geo-Coder-PlaceFinder>

o RT: CPAN’s request tracker

<http://rt.cpan.org/Public/Dist/Display.html?Name=Geo-Coder-PlaceFinder>

o Search CPAN

<http://search.cpan.org/dist/Geo-Coder-PlaceFinder/>

COPYRIGHT AND LICENSE

Copyright (C) 2010-2011 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>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GEO::CODER::PLACEFINDER (3) 2011-06-01

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.