ibazz — 2010-01-22T14:25:39-05:00 — #1
I have a made a query which as far as I can tell, returns the data that it should. The issue I have is that it is telling me an incorrect distance.
This is the join part of the query:
sqrt( ( latitude_miles - 54.6665 )^2
+ ( longitude_mpd * (longitude - 5.66341 ))^2
) as distance
ORDER BY distance;
I can't see anything wrong there so, maybe my statement which inserted the values for latitude_miles and longitude_mpd was wrong?
latitude_miles = 69.1 * latitude,
longitude_mpd = 69.1 * COS(latitude * 3.14159265 / 180)
any pointers are welcome.
guido2004 — 2010-01-22T15:09:22-05:00 — #2
I guess it depends on the georeferential system you're using? If the queries aren't giving any errors, then it surely isn't a SQL problem.
What are the formulas you wanted to implement?
ibazz — 2010-01-23T00:57:58-05:00 — #3
Not sure what you mean by 'which georeferential system I am using'. If you are willing to explain, I would find it helpful I think.
I did get it sorted though and it was a mysql problem - well actually, it was mine. I didn't get a mysql error but when I made the join differently, I suddenly got the results I needed.