NAME

Geo::Coder::ArcGIS - Geocode addresses with ArcGIS

SYNOPSIS

use Geo::Coder::ArcGIS;

my $geocoder = Geo::Coder::ArcGIS->new;
my $location = $geocoder->geocode(
    location => '380 New York Street, Redlands, CA',
);

DESCRIPTION

The Geo::Coder::ArcGIS module provides an interface to the ArcGIS Online geocoding service.

METHODS

new

$geocoder = Geo::Coder::ArcGIS->new

Accepts the following named arguments:

  • compress

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

  • debug

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

  • https

    Use https protocol for securing network traffic. (default: 0)

  • ua

    A custom LWP::UserAgent object. (optional)

geocode

$location = $geocoder->geocode(location => $location)
@locations = $geocoder->geocode(location => $location)

Accepts the following named arguments:

  • location

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

  • raw

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

In scalar context, this method returns the first location result; and in list context it returns all location results.

An example of the data structure representing a location result:

{
    address => "380 New York St, Redlands, CA 92373 San Bernardino, USA",
    attributes => {
        East_Lon   => -117.1929409,
        MatchLevel => "houseNumber",
        North_Lat  => 34.058295,
        Score      => 100,
        South_Lat  => 34.0560467,
        West_Lon   => -117.1956547,
    },
    location => { x => -117.1942978, y => 34.0571709 },
    score    => 100,
}

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://www.arcgis.com/home/webmap/viewer.html

REQUESTS AND BUGS

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

You can also look for information at:

COPYRIGHT AND LICENSE

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