NAME

Geo::Coder::TomTom - Geocode addresses with the TomTom route planner

SYNOPSIS

use Geo::Coder::TomTom;

my $geocoder = Geo::Coder::TomTom->new;
my $location = $geocoder->geocode(
    location => 'Hollywood and Highland, Los Angeles, CA'
);

DESCRIPTION

The Geo::Coder::TomTom module provides an interface to the geocoding service of the TomTom route planner through the unofficial (as-yet unpublished) REST API.

METHODS

new

$geocoder = Geo::Coder::TomTom->new();

Creates a new geocoding object.

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:

{
    category         => 7373,
    city             => "Hollywood",
    country          => "United States",
    countryISO3      => "USA",
    formattedAddress => "Hollywood & Highland, Hollywood, CA, US",
    geohash          => "9q5cgpgrfetr",
    heightMeters     => 0,
    latitude         => "34.10154",
    longitude        => "-118.34015",
    mapName          => "usacanadaandmexicop",
    name             => "Hollywood & Highland",
    score            => 1,
    state            => "CA",
    type             => "poi",
    widthMeters      => 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://routes.tomtom.com/

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

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>