Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    May 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Nearest Store locator

    Hi all,

    I'm looking to build a website for a local UK based kebab shop, i'm looking for a way to have a nearest store redirect where a customer can type in their postcode and they are then redirected to the page which will correspond to their nearest store.

    After hours trawling the net the closest I can find to this is using the google maps API but if I can help it I don't want to have a map shown.

    To give you an idea im looking for something like this:

    http://www.pizzahut.co.uk/
    http://www.dominos.co.uk/

    any help or advice on this matter would be greatly appreciated.

    Myn

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,511
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    In the U.S., there is a database for all zipcodes. It then has the GPS coordinates
    for each zipcode. I'm guessing you might have the same type of thing in the UK?
    With the GPS coordinates, some math functions give the closest location.

    Do some Google searches for "postal code database" or "postal code GPS"

  • #3
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    The official UK postcode database costs thousands of pounds from the Royal Mail but there are a number of unofficial alternatives.

    http://www.easypeasy.com/guides/article.php?article=64
    http://www.freethepostcode.org/
    http://www.jibble.org/ukpostcodes/

    Of course, these are unofficial and may not be 100% accurate of up-to-date
    Last edited by NancyJ; 05-14-2008 at 06:49 PM.

  • #4
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    A quick and dirty alternative is to do partial post-code matching, how effective it will be depends on how many stores they have and how clustered they are.

    For example. a Post Code: BL2 6TB would look for a store with a postcode starting with BL.
    Obviously this doesn't work if they have multiple stores within the same city/area (with the first 2 letters of the postcode the same) and even then its not 100% accurate, the nearest store might be in a different post code area and anywhere there was no store would have to return 'no results in your area'. But its free.

  • #5
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    sites like postcodeanywhere and epostcode provide web-services that let you query the full database without paying quite so much money, they charge a few pence per query.
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com

  • #6
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    Quote Originally Posted by GJay View Post
    sites like postcodeanywhere and epostcode provide web-services that let you query the full database without paying quite so much money, they charge a few pence per query.
    that 1.3p per query easily adds up - if you want to use it for all visitors (like pizza hut and dominos) you could rack up a bill of £5k a year with a modest traffic of 1,000 visitors a day (plus, you only get that rate if you pay for 200,000 clicks)

  • #7
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    http://www.nearby.org.uk/api/convert-help.php

    This site lets you download a database you could use on your own site to query.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •