Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

UK Postcodes : nearby/adjacent

Options
  • 29-06-2007 4:22pm
    #1
    Closed Accounts Posts: 18,163 ✭✭✭✭


    Hi folks

    A client of ours is looking for a site that has the capability to make suggestions based on the web visitors postcode or county, listing nearby results first.

    We've done something similar for Irish counties (which is where she spotted it) but I'm not sure how complex an equivalent for the UK would be ?

    There are (pretty expensive) paid-for resources that do it, but the subscription for those is an issue for her.

    Has anyone tried anything similar in the past ? If so, any chance of a few pointers, or possibly licensing the code from you ?

    Tech note: Site will be a PHP / MySQL / JavaScript / jQuery combo, so the postcode info would need to integrate into that.

    Cheers,
    L


Comments

  • Closed Accounts Posts: 22 replicantface


    pm sent


  • Registered Users Posts: 648 ✭✭✭ChicoMendez


    you could try querying google maps api to get the long/lat based on the address, postal code and then use that to get distance from whatever you are talking about ?


    tnx


  • Registered Users Posts: 4,468 ✭✭✭matt-dublin


    add an extra colum in the relevant table and add nearby postcodes seperated by a comma.

    then when a user enters their postcode do a select sequence like:

    select * from tablename where postcodes like %xxxxxxx%

    that should give you what you need and is fairly straight forward


  • Registered Users Posts: 7,412 ✭✭✭jmcc


    The UK Postcodes are based on longitude/latitude (or at least there is a formula for converting them to long/lat and vice versa). It might be possible to find it on the web.

    Regards...jmcc


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    add an extra colum in the relevant table and add nearby postcodes seperated by a comma.

    That's what we've done for previous clients in Ireland (using the counties as the basis), but the complexity for postcodes seemed like it would require something more intuitive/intelligent/automatic, particularly if the "nearby" was based on a distance that the user could enter.

    I've since found a zip file containing all the postcodes & lat/long co-ords so am going to have a look at reverse-engineering that.


  • Advertisement
  • Registered Users Posts: 648 ✭✭✭ChicoMendez


    hi liam
    would i be able to get that zip off you please ?

    i have a function that calculates distance between two long/lats if you want it ?

    tnx


Advertisement