For my iPhone app, I have gained user's location in a variable userLocation
and I am updating it continuously using CLLocationManager didUpdateLocations
method.
In my parse database, I have thousands of stored locations.
My question is what would be the most efficient way to continuously compare/tell if any of those parse db locations are within 100 meters of user's current location?
My current approach is to go through the array of database locations each time user's location changes; calculate distance from current location and tell if distance is less than 100 meters BUT as the location changes continuously, this will be heavy on processor and battery. Any suggestions?