The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

NAME

Geo::Coder::Navteq - Geocode addresses with the Navteq MapTP AJAX API

SYNOPSIS

my $geocoder = Geo::Coder::Navteq->new(
appkey => 'Your Navteq MapTP AJAX API application key'
);
my $location = $geocoder->geocode(
location => '425 W Randolph St, Chicago, IL'
);

DESCRIPTION

The Geo::Coder::Navteq module provides an interface to the geocoding functionality of the Navteq MapTP AJAX API.

METHODS

new

$geocoder = Geo::Coder::Navteq->new(
'Your MapTP AJAX API application key'
)
$geocoder = Geo::Coder::Navteq->new(
key => 'Your MapTP AJAX API application key',
debug => 1,
)

Creates a new geocoding object.

An application key can be obtained here: http://www.nn4d.com/site/global/build/web_apis/ajax_api_20/free_ajax_key/ajax_free_register.jsp

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:

{
Coordinate => {
Elevation => "0.0",
Latitude => "41.88447265625",
Longitude => "-87.6388753255208"
},
Hierarchy => 6,
PropertiesMajor => {
City => "Chicago",
Ctry => "US",
Cty => "Cook",
Sta => "IL",
Street => "425 W Randolph St",
Zip => 60606,
},
PropertiesMinor => {
Distance => "0.0",
ID => 0,
Lang => "ENG",
LUID => "NT_4N4sL870u5vRO9r+Zt+44A",
Q => 1,
S => 100,
Size => 1,
Type => 6,
Variance => "0.0029503035",
X0 => "-87.6398",
X1 => "-87.6339",
Y0 => "41.8844966666667",
Y1 => "41.8844",
},
Quality => "Exact",
Similarity => "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://www.nn4d.com/site/global/build/manuals/ajaxapiintroduction.jsp

Geo::Coder::Bing, Geo::Coder::Bing::Bulk, Geo::Coder::Google, Geo::Coder::Mapquest, Geo::Coder::Multimap, Geo::Coder::OSM, Geo::Coder::PlaceFinder, 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-Navteq. 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::Navteq

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>