Firstly I apologize for the Title! I couldn't think how to word it!
I have a database with all the area codes in the UK with their average latitudes and longitudes. Now I want to be able to calculate which area codes are within 'n' miles from another.
I tried running a massive calculation on my local host to work out all the distances and store them in a massive database, so all i have to do is look up the distances later, but it ran out of memory, and I'm wondering if that's the best way to go about it? Am I overlooking an easy way to calculate it on the fly?
So to make it clear, I want people to be able to enter an area code and a range in miles, and then get all the area codes within that range. The information i have available is a database with the fields:
| Postcode_ID | Pcode | GRID_N | GRID_E | Latitude | Longitude |