Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Postcode / Distance
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Postcode / Distance

 Post Reply Post Reply
Author
Gary View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 March 2002
Location: United Kingdom
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gary Quote  Post ReplyReply Direct Link To This Post Topic: Postcode / Distance
    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

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
djscout View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2002
Location: United States
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote djscout Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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:
Click here
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.