How easy is it the search the UK?

Discussion in 'PHP' started by sabian1982, Jan 28, 2007.

  1. #1
    I'm in the process of developing the idea for a website and i need the ability for people visiting the site to a search based on location - a bit like you get on a dating site or a job site where you say i want something in location x, what is in location x and what is within say (for example) 5 miles, 10 miles etc.

    How is such a system created? Surely every distance between every single location cannot be measured and put into the database?

    I'm just looking for a general answer (not a programming answer).

    Any ideas, if someone could shed light on how it is done that would be great.
     
    sabian1982, Jan 28, 2007 IP
  2. SilkySmooth

    SilkySmooth Well-Known Member

    Messages:
    1,583
    Likes Received:
    269
    Best Answers:
    0
    Trophy Points:
    180
    #2
    I have never worked on one myself, but I am fairly certain such systems are based upon latitude and longitude algorithms. E.g. when company XYZ is added to the database, the latitude and longitude for the location are stored based on this you can then calculate the mileage distance from search to location.

    I Google'd and found this script which may help with the algorithm side of things: http://www.goldsofts DOT com/script/606/13409/Geographic_Distance_and_Azimuth_Calculations.html

    However I am not sure how you go about obtaining the latitude and longitude for where the company XYZ is.

    I also found this article (2 Parts) which may be helpful:

    http://blog.ocfoodreview DOT com/2006/06/29/notes-on-implementing-location-based-search-part-1-of-2/

    Note you have to replace the DOT with a dot as I am too new to the forum to post working URL's.

    HTH
     
    SilkySmooth, Jan 28, 2007 IP
  3. sabian1982

    sabian1982 Notable Member

    Messages:
    2,028
    Likes Received:
    161
    Best Answers:
    0
    Trophy Points:
    210
    #3
    Thanks silkysmooth, ill take a look - at the end of the day i won't be doing the scripting, ill be paying someone to create a search facility, at this stage im just interested to know how complex it will be to do...

    Anyone else...?
     
    sabian1982, Jan 28, 2007 IP
  4. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can use ZIP codes - you enter them along with the (average) latitude and longitude, calculating distances from that should be quite easy. Moreover if you let users enter their details they'll for sure know their ZIP code, while it's a bit tougher to ask them for their lat and lng...
     
    picouli, Jan 28, 2007 IP
  5. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #5
    There's a script for this (US & Canada however) which is very easy to use. I haven't seen one for the UK but I'm sure it can be done.
    Actually I just did a quick search and found this :
    http://www.milldo.com/en16_uk_post_codes_database.htm
    But it is quite expensive so you can probably take your time and look for something similar.
     
    maiahost, Jan 28, 2007 IP
    sabian1982 likes this.
  6. sabian1982

    sabian1982 Notable Member

    Messages:
    2,028
    Likes Received:
    161
    Best Answers:
    0
    Trophy Points:
    210
    #6
    Thanks thats a great link i've book marked it for future reference and $100 isn't really too much for that amount of data (as long as it works at the end of the day) - i mean im looking at a budget of $1000-$2500ish for the entire project; although that obviously depends on quotes. The search facility is just part of the site im developing... will be outsourcing the coding etc to someone on rentacoder most probably...
     
    sabian1982, Jan 28, 2007 IP
  7. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #7
    picouli, Jan 28, 2007 IP
    sabian1982 likes this.