PHP code example of lukaswhite / uk-postcode-geocoder

1. Go to this page and download the library: Download lukaswhite/uk-postcode-geocoder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lukaswhite / uk-postcode-geocoder example snippets


use Lukaswhite\UkPostCodeGeocoder\Service;

$service = new Service( '/path/to/db' );

$service = new Service( '/path/to/db', 'db.sqlite );

$coordinates = $service->get( 'SW1A 2AA' );

$results = $service->getMultiple( 'AB1 0AG', 'AB1 0AL', 'AB1 0AD' );

$service->add(
	'sw1A2aa',
	new Coordinate( 51.50354, -0.127695 )
);