Print Page | Close Window

Postcode / Distance

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=500
Printed Date: 28 March 2026 at 8:51pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Postcode / Distance
Posted By: Gary
Subject: Postcode / Distance
Date Posted: 25 February 2003 at 4:40am

Many ecommerce sites now have a feature whereby you enter your postcode and specify a distance that you are willing to travel (eg autotrader).

How is this done & can I get it for free ???

Thx




Replies:
Posted By: michael
Date Posted: 25 February 2003 at 10:53am
Well I don't know how Postcodes are setup in the UK but taking the US for an example there is no way to calcualte an exact difference between ZIP codes. There is no standard on orientation and size of a ZIP Code area so it would be merely a guesstimate. I am sure that those sites have a zip database and and a Lat/Lon coordinate behind it. Then you can calculate the distance between those coordinates which again is not too accurate as it does not consider altitude changes and takes an average in the earths' arc. I found a few Databases to download and you would have to do all the calculation itself but again, you might want to do it for the UK where it is all different.


Posted By: djscout
Date Posted: 27 February 2003 at 4:51am
Im sure if this was coded and programmed in, seeing as autotrader.com is a HUGE site with a lot of money coming in, i would be supprised if they set it up with zones or had a team develop something like this.  i know a while back i worked with a friend to setup a zip-code system where it calculated which store was closer to you from your home, this was unreal because zip codes dont follow a standerd grid, they are just almost randomly placed..  very hard thing to work with.

-------------
++ jim..


Posted By: Bunce
Date Posted: 27 February 2003 at 5:33am

If not already, there will be web-services available soon that will provide lat/long values given a postcode.

Thats all you need: two points and the forumula..



-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: michael
Date Posted: 27 February 2003 at 1:25pm
OK, I wrote a little script to do what you wanted. Again, this is for US only but should be easily adaptable to UK or any other country. It is not fool proof and there is not error handler in there but check it out and let me know if this is what you where looking for:
http://www.webapp.us/app/distancecalc/ - Click here



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net