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
Geo::Coder::PlaceFinder(3) User Contributed Perl Documentation Geo::Coder::PlaceFinder(3)

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

    use Geo::Coder::PlaceFinder;

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

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

   $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:

  • appid

    A Yahoo Application ID. (required)

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

  • ua

    A custom LWP::UserAgent object. (optional)

  • compress

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

  • debug

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

    $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:

  • location

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

  • 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:

  • flags

    JRSTX

  • 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 = $geocoder->response()

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

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

Accessor for the UserAgent object.

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

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.

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

    perldoc Geo::Coder::PlaceFinder

You can also look for information at:

  • GitHub Source Repository

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

  • AnnoCPAN: Annotated CPAN documentation

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

  • CPAN Ratings

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

  • RT: CPAN's request tracker

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

  • Search CPAN

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

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.

gray, <gray at cpan.org>
2011-06-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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