Thanks to Wikileaks, here in the UK we can now access our longitude and latitude co-ordinates for each post code wikileaks postcodes uk IMPORTANT. Do not use this data in public applications - There's concern that the data has been deliberately corrupted and you could be held as being in breach of copyright law. Try using data from an open source site like this Postcode UK site
Now, it's possible to calculate distances between each point using the following calculation (originally from the fine book Pro Mysql):
The distance d between two points (x1,y1) and (x2,y2) can be calculated from the following equation (so long as x values are latitude and y values are longitude in radians, r is the radius of the sphere which is 3956 in miles):
d= acos(sin(x1)sin(x2)+cos(x1)cos(x2)*cos(y2-y1)) * r
Now is this good enough, or should I use the new GIS data types and functions, and if so, how do I convert my longitude and latitude references to the Point data type? I realise that because the Earth is not a perfect sphere, so the distance calculation I quote above is not perfect; however it's good enough for my purposes. Would using the new GIS functionality a) make calculation of distance quicker b) make the distance calculation more exact?