Haven't looked at the module yet, don't know where he's getting the data from.
Kake
----- Forwarded message from william ross will@spanner.org -----
From: william ross will@spanner.org Date: Tue, 31 Aug 2004 19:39:06 +0100 To: CDBI cdbi-talk@groups.kasei.com Subject: Geo::Postcode
Hello,
I've just finished (for now) and uploaded the module that I use to work with UK postcodes. It handles validation, parsing, location and the common distance-to-here calculation in a fairly economical way, and it can deal transparently with postcodes at different resolutions (ie it will tell you how far it is from 'SW1' to 'EC1Y 8PQ'), to allow for the various data sets that are available.
At the moment it's up as Geo::Postcode, but that may well change in order to sit nicely next to similar modules from other countries.
The accuracy of its measurements depends on the data set that it's working with. It comes with a basic set of nearly 3000 points that pretty much covers all the postcode areas (like 'E1' or 'LA23'), but no more. That's enough to get started and rough out an application, but for serious public use you will need to license the use of a proper postcode set. The module is designed to accept all sorts of data sources without too much trouble.
I mention it here because I use it mostly with CDBI apps, so it is designed to inflate and deflate cleanly as a has_a. If a class already has a se[arate postcode field, it can just be dropped in:
My::Person->has_a( postcode => 'Geo::Postcode' ); My::Cinema->has_a( postcode => 'Geo::Postcode' );
my $distance = $person->postcode->distance_from( $cinema->postcode );
...and much more.
I hope it turns out to be useful, and I'd be very glad of feedback and improvements.
best
will
ps. if it hasn't reached your mirror, try www.spanner.org/postcodes/
----- End forwarded message -----
On Tue, Aug 31, 2004 at 08:27:28PM +0100, Kake L Pugh wrote:
Haven't looked at the module yet, don't know where he's getting the data from.
According to http://www.spanner.org/postcodes/ he provides a basic public domain dataset which provides a mapping of the first half of the postcode to location data but not much more. So the really useful bit would depend on someone buying us some nice crunchy data.
In the meantime, the validation routines may be worth sticking into OpenGuides.
Cheers,
Dominic.
The website for the postcode module points to this site for getting the data http://jibble.org/ukpostcodes/
It seems to have been put together by three guys - though it isn't clear how they did it.
It only covers the major part of the postcode - eg the "E11" of "E11 1LT" so it isn't going to be terribly useful - but better than nothing. (This seems to contradict the original poster so maybe I am wrong).
From the website:
" Thanks to William Platts for the OS grid reference data, Jonathan Stott for the latitudes and longitudes, and Jon Godwin for detecting and correcting some locations."
One also has to wonder how they got the list of postcodes in the first place because the Royal Mail might try claiming that it was part of their copyrighted database... I wouldn't put it past them.
Alex
On Tue, 31 Aug 2004 20:27:28 +0100, Kake L Pugh kake@earth.li wrote:
Haven't looked at the module yet, don't know where he's getting the data from.
Kake
----- Forwarded message from william ross will@spanner.org -----
From: william ross will@spanner.org Date: Tue, 31 Aug 2004 19:39:06 +0100 To: CDBI cdbi-talk@groups.kasei.com Subject: Geo::Postcode
Hello,
I've just finished (for now) and uploaded the module that I use to work with UK postcodes. It handles validation, parsing, location and the common distance-to-here calculation in a fairly economical way, and it can deal transparently with postcodes at different resolutions (ie it will tell you how far it is from 'SW1' to 'EC1Y 8PQ'), to allow for the various data sets that are available.
At the moment it's up as Geo::Postcode, but that may well change in order to sit nicely next to similar modules from other countries.
openguides-dev@lists.openguides.org