Forum Moderators: phranque

Message Too Old, No Replies

searchby UK postcode

         

kess070

4:40 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



Hi

Help gratefully appreciated please.

I'm developing a "classifieds" Ads website (that allows people to add and browse classifieds Adverts) that needs a “search Ads” facility, by UK postcode.

Can someone please help and tell me how you can develop a facility for users to search the site ads by typing in UK postcode that brings up the nearest areas featuring the ads (say within a selected distance of nearest 10 miles) A good example of what i'm trying to achieve is the search facility on top left of loot.com that allows you to search by postcode and nearest distance.

Do some sort of plug-ins exist that i can integrate or is it moe complicated then that...?

Thanks a million in advance

Sonia

physics

5:34 pm on Sep 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might have a look at the Google maps api.

kess070

9:20 am on Sep 22, 2005 (gmt 0)

10+ Year Member



Thanks Physics. I've just had a look at google api but noticed that it says "The Maps API is a free beta service, available for any web site that is FREE to consumers."

Unnfortunately the site will ask for members to pay to submit adverts so dont know if i could get away with using google?

thanks

zulu_dude

10:13 am on Sep 22, 2005 (gmt 0)

10+ Year Member Top Contributors Of The Month



You'd probably need to implement it in PHP (or ASP) yourself. Although it is pretty easy to calculate distances between places, you'd need format those results to suit your needs.

The way it works is each postcode has a latitude and logitude assigned to it. The script then works out the distance between them using simple maths.

The hardest part is finding a list of UK postcodes with their respective co-ordinates. However, there are one or two sources that will give you a list of the first half of the postcodes (e.g. just the SW1 part) and their co-ordinates for free. To get the full postcode (e.g. SW1 2BB), you have to pay. It all depends on exactly how accurate you need it to be. From what I can tell, the half-postcode list would suit your needs fine...

kess070

10:27 am on Sep 22, 2005 (gmt 0)

10+ Year Member



Thanks Zulu, much appreciate your reply.

Any idea where i can get the free list of "half" postcodes?

thanks in advance

zulu_dude

1:01 pm on Sep 22, 2005 (gmt 0)

10+ Year Member Top Contributors Of The Month



Sure, no worries... just search in Google for "php uk postcode distance" (without quotes). I think one of the sites where I saw it comes up no 1.

I've also sticky-mailed the address to you, should the above not work.

kess070

2:01 pm on Sep 22, 2005 (gmt 0)

10+ Year Member



Thanks a lot