Getting Lat Lon Co-ordinates based on full postcodes (Script conversion)

238 Views Asked by At

I have a website that uses UK postcodes lat and lon co-ordinates to allow members to search within a given distance but this only uses basic areas (LS2, WF1, etc). What I want to do is to get the lon/lat co-ordinates for the full postcode so that the search is more precise. I've heard that you can do this with a Google API but I have no idea if this will give me the same details as I have now or how I could incorporate it into my site. Here is a rundown of what happens now:

>     User enters basic postal area into a form (LS2 for example)
>     It is then passed (with other form data) through JQuery Post to php file
>     PHP file sorts out the city, county, lon, lat information from postcodes table based on the given post area
>     + Enters the data into a table with other form data
>     Result is echoed back and user is redirected if successful

Is there a way of adding the geo-coding script into the php file & will it get the information that I require? I'd also like this to work outside of the UK

0

There are 0 best solutions below