nuicart / dutchgeo
For all the non dutch speakers that seek a way to convert a Dutch postalcode to a lat/long map coordnates using the Google maps API.
Installs: 411
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/nuicart/dutchgeo
Requires (Dev)
- phpunit/phpunit: ^6.1
This package is auto-updated.
Last update: 2020-06-10 12:13:15 UTC
README
Get latitude / longitude by Dutch postal / zip code. An easy job if you speak Dutch but for a not native speaker a bit of a search.
Getting Started
Just install with composer, call Postal::getLatLong('1421AW'); and you are all done. The script uses curl so you need php with lib curl or copy/paste the sourcecode and use file_get_contents.
Author
- Anton Boutkam
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Usage
try{
$oLatLong = Postal::getLatLong('1421AW');
}
catch(NotFoundException $e)
{
// The postal was not found, is it a real address?
// Make someone fix the addresss?
}
catch(InvalidArgumentException $e)
{
// The format of the postal/zip code is does not comply with Dutch standards: /^[0-9]{4}[A-Z]{2}$/,
// Make someone fix the addresss?
}
catch(ApiException $e)
{
// Have a look at your cronjob / script. To many queries maybe?
}