circular buffer around a central point
Posted: Sun Mar 14, 2004 9:53 am
I have a database full of OS grid references related to postcodes. I need to be able to extract all postcodes that appear a certain distance away from a postcode that a user enters.
so...
1. user enters postcode into form
2. easting (horizontal) and northing (vertical) grid references for entered postcode are retrieved from the database.
3. PHP used to locate all postcodes (by querying other easting and nothings) that are within a certain distance from postcode entered in stage 1.
The problem. This is fairly easy to do if you take the entered postcode and then draw a square around it of a certain size but I would like to be able to retrieve postcodes by drawing a circle around the entered postcode. Is this possible with PHP and if so how???
Complicated to explain I know - if there are any further questions just post back.
T
so...
1. user enters postcode into form
2. easting (horizontal) and northing (vertical) grid references for entered postcode are retrieved from the database.
3. PHP used to locate all postcodes (by querying other easting and nothings) that are within a certain distance from postcode entered in stage 1.
The problem. This is fairly easy to do if you take the entered postcode and then draw a square around it of a certain size but I would like to be able to retrieve postcodes by drawing a circle around the entered postcode. Is this possible with PHP and if so how???
Complicated to explain I know - if there are any further questions just post back.
T