var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Need help in GEO query
SELECT * , 3956 *2 * ASIN( SQRT( POWER( SIN( ( 122.4058 - ABS( dest.lat ) ) * PI( ) /180 /2 ) , 2 ) + COS( 122.4058 * PI( ) /180 ) * COS( ABS( dest.lat ) * PI( ) /180 ) * POWER( SIN( ( 37.7907 - dest.lon ) * PI( ) /180 /2 ) , 2 ) ) ) AS distance
FROM members dest
HAVING distance <25
Above query run perfectly .. Users will have one field name search_distance .. So i want to calculate users location and current location distance based in search_distance ..
Please help me to solve this ! Let me know if this is not clear
User Table have below fields
id, user_name, lat, lon, search_distance
This is not clear. If you are looking for assistance in rewriting the formula or a problem with the database/SQL?
Yes, I need help rewrite query ..This query will search lat,lon inside 25km redius from current location ...
Now I want to add constraint .. Based on searched lat,lon list i want to calculate current location's distance..
Let me know if still not clear ..
Last edited by mavrick4sky; 12-22-11 at 06:40.
Tags for this Thread