I have a database with thousands of users having latitude and longitude values, I want to get all users from database who are within 1 km radius around my current location.
say I am at location A with my lat 10 and long 20. I have to search users nearby with the range of 1 km.... and these user locations are stored in database.
one way I figured out to get each user lat and lon and compare with mine with iOS method distanceFromLocation:
but that requires each value to be fetched first and then calculated with method..Is there any other way ? Maybe to do this on database side?