I am looking into using DreamFactory for my REST API.. I have a table called 'tags
' that has a collumn called 'lat
' and one called 'lon
' for latitude and longitude of locations stored in my 'db'
Problem is i need to be able to pass a latitude and longitude along with a distance
to my service call and filter the results to only return the rows where
the location is <= the distance provided from the latitude and longitude i provided..
My SQL commands are a bit rusty but something like this:
SELECT *, 3956 * 2 * ASIN(SQRT( POWER(SIN((42.347109 - abs(tags.lat)) * pi()/180 / 2),2) +
COS(42.347109 * pi()/180 ) * COS( abs (lat) * pi()/180) * POWER(SIN((-71.075589 – tags.lon) *
pi()/180 / 2), 2) )) as distance FROM tags having distance < 2;
anyone have experience doing this sort of filter? especially with DreamFactory?