MySQL Forums
Forum List  »  GIS

Re: What returns from distance function?
Posted by: Bjorn Brala
Date: May 07, 2010 01:35AM

I've seen a colleage use the following formula to get distance from the database,

( 6371 * acos( cos( radians(".$fLat.") ) * cos( radians( X(v.geo) ) ) * cos( radians( Y(v.geo) ) - radians(".$fLng.") ) + sin( radians(".$fLat.") ) * sin( radians( X(v.geo) ) ) ) ) AS distance

This results in a distance in KM, geo is a geometry field, fLat/fLng are well, lat and long ;)

Anyways, that might help you find you find out if the distance function related to meters or not.

Options: ReplyQuote


Subject
Views
Written By
Posted
5128
April 18, 2010 06:01AM
4781
April 18, 2010 11:13AM
Re: What returns from distance function?
3955
May 07, 2010 01:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.