PHP client for TomTom Geocoding API
- TomTomGeocoder.php: encapsulates the communication with TomTom geocoding server
- SampleScript.php: sample file showing the usage
- instantiate the TomTom geocoding client
require_once __DIR__.'/TomTomGeocoder.php';
$geocoder = new GeocoderPro\Geocoder\TomTom\TomTomGeocoder('YOUR_API_KEY');
You can obtain your API key at TomTom's developer portal.
- geocode the address
$result = $geocoder->geocodeAddress('New York', 'USA', 20, '11 West 53 Street', null, '10019', 'NY');
Depending on the geocoding result, you will receive one address or a a list of addresses, with latitude and longitue, along with additional data provided by TomTom.
php SampleScript.php
Geocoding MOMA, NYC...
formattedAddress: 53 W 53rd St, Midtown, New York, New York 1001954, US
type: addresspoint
latitude: 40.761540
longitude: -73.978480
geohash: dr5rus6t0mz1
score: 1.000000
confidence: 0.201106
See SampleScript.php for a working sample.
Licensed under MIT license (refer to LICENSE for the license text and more information). Please credit http://www.geocoderpro.com e.g. using a link from your website.
Please contact us at http://www.geocoderpro.com/ if you need help.