Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Calculating Distanceby rinceWind (Monsignor) |
on Feb 21, 2007 at 19:13 UTC ( [id://601407]=note: print w/replies, xml ) | Need Help?? |
We've encountered this requirement for http://openguides.org. Here, alongside the lat + long, we store planar X-Y coordinates in the database, using a projection such as UTM or Ordnance Survey. Then, we use Pythagoras in SQL queries to find all entries within the distance. This works well for city guides - our main application, but less well over large distances, where curvature of the oblate spheroid that is the Earth, becomes a factor. I don't know what your application is, but check out OpenGuides, as there's probably quite a bit of code you can reuse. Or even set up a Guide yourself, if that's what you are trying to achieve. --
In Section
Seekers of Perl Wisdom
|
|