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::MAPQUEST (3)

.ds Aq ’

NAME

Geo::Coder::Mapquest - Geocode addresses with Mapquest

CONTENTS

SYNOPSIS



    use Geo::Coder::Mapquest;

    my $geocoder = Geo::Coder::Mapquest->new(apikey => Your API key);
    my $location = $geocoder->geocode(
        location => Hollywood and Highland, Los Angeles, CA
    );



DESCRIPTION

The Geo::Coder::Mapquest module provides an interface to the Mapquest Geocoding Web Service.

METHODS

    new



    $geocoder = Geo::Coder::Mapquest->new(apikey => Your API key)
    $geocoder = Geo::Coder::Mapquest->new(
        apikey => Your API key
        https  => 1,
        debug  => 1,
    )



Creates a new geocoding object.

A valid developer ’apikey’ is required. See NOTES on how to obtain one and set it up.

Accepts an optional <B>openB> parameter for using the open data platform.

Accepts an optional <B>httpsB> parameter for securing network traffic.

Accepts an optional <B>uaB> 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:



    {
        adminArea1         => "US",
        adminArea1Type     => "Country",
        adminArea3         => "CA",
        adminArea3Type     => "State",
        adminArea4         => "Los Angeles County",
        adminArea4Type     => "County",
        adminArea5         => "Los Angeles",
        adminArea5Type     => "City",
        displayLatLng      => { lat => "34.10155", lng => "-118.33869" },
        dragPoint          => 0,
        geocodeQuality     => "INTERSECTION",
        geocodeQualityCode => "I1CAA",
        latLng             => { lat => "34.10155", lng => "-118.33869" },
        linkId             => 0,
        mapUrl             => "http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-1,34.10155,-118.33869,0,0|¢er=34.10155,-118.33869&zoom=12&key=Dmjtd|lu612ha7ng,ag=o5-5at2u&rand=1659284599",
        postalCode         => 90028,
        providedLocation   => "Hollywood and Highland, Los Angeles, CA",
        sideOfStreet       => "N",
        street             => "Hollywood Blvd & N Highland Ave",
        type               => "s",
    }



    batch



    @results = $geocoder->batch(locations => [ $location, ... ])



Allows up to 100 locations to be geocoded in the same request. Returns a list of results, each of which is a reference to a list of locations. Will croak if more than 100 locations are given.

    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.

NOTES

An API key can be obtained here: <http://developer.mapquest.com/web/info/account/app-keys>.

After obtaining a key, you must enable the Blank Referers option for the account.

Note that Mapquest already url-encodes the key, so the geocoder constructor will prevent it from being doubly-encoded. Ensure you do not decode it yourself before passing it to the constructor.

International (non-US) queries do not appear to be fully supported by the service at this time.

SEE ALSO

<http://www.mapquestapi.com/geocoding/>

<http://developer.mapquest.com/web/tools/getting-started/platform/licensed-vs-open>

REQUESTS AND BUGS

Please report any bugs or feature requests to <http://rt.cpan.org/Public/Bug/Report.html?Queue=Geo-Coder-Mapquest>. 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::Mapquest



You can also look for information at:
o GitHub Source Repository

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

o AnnoCPAN: Annotated CPAN documentation

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

o CPAN Ratings

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

o RT: CPAN’s request tracker

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

o Search CPAN

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

COPYRIGHT AND LICENSE

Copyright (C) 2009-2013 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::MAPQUEST (3) 2013-06-28

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