Where magic lives

Monday, November 05, 2007

My new apartment

Here is the apartment that I will soon be moving in to:


View Larger Map

Labels: , ,

Tuesday, January 02, 2007

Converting between Latitude/Longitude & OS National Grid Reference points in PHP (another fun postcode map)

I decided to have a play around with the Google Maps Javascript API. Seeing as I recently acquired the UK postcode database I thought I'd plot postcodes onto Google Maps.

The tricky part turned out to be converting between the grid references used in the PAF and latitude and longitude. Fortunately I found a page explaining how to do the conversion in Javascript. I needed the conversion to be done server side so I have ported the code to PHP [source].

To play with my map go to this page. To stop people screen scraping my postcode database the script will stop working after you have moved the map more than 200 times.

Labels: ,

Sunday, December 17, 2006

UK Postcode Coverage Map

On a website that I have been making I had to provide a "Find my nearest" page, one of those things where people enter their postcode to find the nearest outlet of the company in question. An easy application of Pythagoras' Theorem using the full UK postcode database that I was provided with.

In a bored moment today though I wrote a short little program to go through the database and mark a dot on a blank canvas for the coordinates of each post code. As can be seen I got a very realistic outline of Britain. Although, I was a bit disturbed by the shape of Wales so I overlayed my data onto a satellite photo of the UK, there does appear to be some sort of a problem, is my database broken?

The satellite overlay does do a good job of confirming that the less postcode dense mainland areas very often correspond to mountainous areas.

Update: Thank you Mapperz for pointing out my mistake (Northern Ireland postcodes work off a different grid system). Seeing as it is not just a simple constant offset between the two grid systems and the company I was making the site for don't have any Northern Ireland outlets, I have just omitted the BT* postcodes from my dataset leaving me with this map.

Labels: ,