473,418 Members | 4,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Calculating distances between post codes

Hi
Can anyone recommend a suitable way of calculating distances between UK post
codes??

Many websites do this, and I'm wondering if there is some standard code, and
where the reference DB comes from?

Any help/advice appreciated

Thanks
Jan 3 '07 #1
3 2569
The post office own that data:

http://www.royalmail.com/portal/rm/j...8&catId=400084
Paul Aspinall wrote:
Hi
Can anyone recommend a suitable way of calculating distances between UK post
codes??

Many websites do this, and I'm wondering if there is some standard code, and
where the reference DB comes from?

Any help/advice appreciated

Thanks
Jan 3 '07 #2
Do you mean a simple projection calculation? Then all you need is the
long/lat. I believe Hopeweiser (among others) will sell you this for a
price... but note that it is around 2.3m rows deep including all
levels. The formala for distance from two geo-codes isn't pretty, but
is reasonably easy (will post if you need it).

If you mean road distance, that is a *whole* other thing, and requires
highly specialised software (MapPoint [desktop/WS], MapQuest, etc).

If you don't want to do the calcs yourself, then look into some of the
web-services; I googled "webservice uk postcode distance" and got a
few hits. As another thought - for a web-page, note that you can use
the google-maps API to do a lot of things like this, as long as your
intent suits client-side processing (i.e. nothing extreme like
calculating a distance triangle for a few thousand nodes).

Marc
Jan 3 '07 #3
"Paul Aspinall" <pa**@aspy.co.ukwrote in message
news:0g*******************@fe2.news.blueyonder.co. uk...
Can anyone recommend a suitable way of calculating distances between UK
post codes??
For that, you need to get hold of the longitude and latitude of each
postcode. This is available from various sources, notably (as you might
imagine!) the Post Office, but it's quite expensive. There are upwards of 2
million postcodes in the UK, so you'll need some sort of RDBMS to hold the
data.

Armed with this, it's simple trigonometry - Pythagorus' theorem, and all
that... 10 years or so ago I did a contract for a mystery shopping company
which had precisely this requirement - i.e. find me the nearest researchers
to a certain Pizza Hut etc... Stored the data in SQL Server and built a
simple stored procedure which accepted the two postcodes as parameters and
returned the distance between them. I might even have it somewhere, but it's
really a five-minute job to write the T-SQL...

Quite a few companies offer access to the postcode database via webservices
so that companies can integrate address lookup and validation into their
apps - this seems pretty much what you're looking for:
http://www.postcodeanywhere.co.uk/de...umentation/uk/
Jan 3 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jayne Wolps | last post by:
Hello I wonder if anyone can help. I would like to know how certain sites: http://aboutbritain.com/ArundelCastle.htm, and http://travel.knowhere.co.uk/place/+bristol-0/ manage to put approx...
3
by: Lowell Kirsh | last post by:
I want to create a link that a user can click which will create a popup telling the user their ip address. I have: var ip = new java.net.InetAddress.getLocalHost().toString(); alert("Your IP...
1
by: Hul Tytus | last post by:
comp.lang.c converting a point known by 4 distances to xyz coordinates? Amongst all the librarys on the internet there is certainly source for a routine that converts a point known by 4...
0
by: hlam | last post by:
Help - Calculating the total of a column in a data grid -- when data grid is part of Master-Detail set-up I have setup a Master-Detail form using Visual Studio.Net. A ListBox is the (Master)...
13
by: racygirl | last post by:
Hi all, I was just wondering, is it possible to write a solution to the following problem with the following criteria: 1. it must be as efficient as possible at run-time 2. be in O(1) 3. and...
0
by: tienlx | last post by:
Hi, I've a report (ReportAppointment.rdlc) in ASP.NET When viewing reports, the vertical distance between the two group are too big. I've tried to reduce the vertical distances but i can't. Demo:...
5
by: eliana82 | last post by:
I have problems calculating score percentages within groups. I have created a boat program in access where the information provided is name, team, boat and score. The first query I've done is...
12
by: waltman1605 | last post by:
I am an inexperienced access user needing to know how to create a formula for making an age automatically change year by year without manually having to do it. I do not know the language, source...
0
by: freefony | last post by:
Am building a web site that deals with student registration and using asp.net But am finding it difficult getting the right codes to both calculating the values Of a column in my table, and how...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.