I have a user model which stores the lat and log of a user in latitude and longitude field.
Now I have a arbitrary point (lat and longitude).
Now what is the best way to find all the users which lies in the radius of 10kms of that arbitrary point.
Does geocoder gem does it?
Thanks
Yup Geocoder have this feature ie to check if it any point (latitude, longitude) lies within certain radius of certian point.
Lets say an arbitrary object of model X with fields latitude = x and longitude = y be obj
Now to find any similar object within m miles radius from obj we can do
This query will return all X’s which lies within x miles radius form obj