I'm trying to build a script that will list all the towns in a given radius centred around a town pulled from a database. Has any one got any suggestions or sources of info. I haven't really got a clue where to start..........
finding towns within a radius of a given town.
Moderator: General Moderators
finding towns within a radius of a given town.
Hi,
I'm trying to build a script that will list all the towns in a given radius centred around a town pulled from a database. Has any one got any suggestions or sources of info. I haven't really got a clue where to start..........
I'm trying to build a script that will list all the towns in a given radius centred around a town pulled from a database. Has any one got any suggestions or sources of info. I haven't really got a clue where to start..........
The only way I can imagine is to give each town an x,y or long., lat. coordinate. You can then, from the starting town, define a square "radius" (d).
x-d<x<x+d
y-d<y<y+d
If you want to have a circular radius things get more complicated. You need to use trigonometry and the SQL query, I think, would be more complicated.
x-d<x<x+d
y-d<y<y+d
If you want to have a circular radius things get more complicated. You need to use trigonometry and the SQL query, I think, would be more complicated.
You are looking at a complicated problem here. This can turn out to be very costly (Mappoint, Mapquest) as you won't (according to me) find a free database. The data is very big and it is usually accessed via the web.
Here is an article on GIS:
http://www.phpbuilder.com/columns/moss20031023.php3
and a uk based site for GIS:
http://www.emapsite.com/
Good Luck
Here is an article on GIS:
http://www.phpbuilder.com/columns/moss20031023.php3
and a uk based site for GIS:
http://www.emapsite.com/
Good Luck