2017 © Pedro Peláez
 

library nearby-uk-postcode-finder

Find all UK Ppostcodes within the radius of a postcode

image

jflight/nearby-uk-postcode-finder

Find all UK Ppostcodes within the radius of a postcode

  • Saturday, July 26, 2014
  • by jamesflight
  • Repository
  • 1 Watchers
  • 0 Stars
  • 168 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PHP Nearby UK Postcode Finder

The postcode finder takes a UK postcode outcode (the bit before the space) and a radius, and returns all other uk postcodes within that radius., (*1)

It is powered by a csv file of postcodes and their longitude and latitude coordinates, and shouldn't be used in production environments where speed is important. The project makes use of the excellent Geotools library., (*2)

Installation

Add to composer.json:, (*3)

    "require": {
        "jflight/nearby-uk-postcode-finder": "dev-master"
    }

Run:, (*4)

composer update

Usage

Create a postcode:, (*5)

$postcode = new Jflight\PostcodeFinder\UkPostcode('CF11');

Get postcodes within a radius of 10 km:, (*6)

$nearbyPostcodes = $postcode->findNearestPostcodes(10)); // Array of postcodes

Extension

In theory, the postcode class could be extended and used for postcodes (or equivalent) for any county, as long as csv lookup of postcodes with their longitude and latitue is available., (*7)

This would be done as follows:, (*8)

<?php

class NewPostcode extends Jflight\PostcodeFinder\Postcode {
    protected $file = "/path/to/csv.csv";
}

The Versions

26/07 2014

dev-master

9999999-dev

Find all UK Ppostcodes within the radius of a postcode

  Sources   Download

The Requires

 

The Development Requires

by James Flight

26/07 2014

0.0.2

0.0.2.0

Find all UK Ppostcodes within the radius of a postcode

  Sources   Download

The Requires

 

The Development Requires

by James Flight

26/07 2014

0.0.1

0.0.1.0

Find all UK Ppostcodes within the radius of a postcode

  Sources   Download

The Requires

 

The Development Requires

by James Flight