1

I have to monitor much more than 20 regions for an iOS app, around 500 to begin with. Therefore I have looked through all the questions related to this issue. I have found that generally people agree that Significant Location Change has to be used in order to recalculate the relative regions for every location change. This answer uses a bounding rectangle, which is calculated and later a check is performed in order to see which locations happen to be in the rectangle.

My question is, what if I use - (CLLocationDistance)getDistanceFrom:(CLLocation *)location from CLLocation in order to calculate the distance from the current location to all 500 other locations. Afterwards sort the distances and find, which are the 20 closest locations and startMonitoringForRegion? I assume this is not the most efficient way to do it, but does the efficiency differ from the above mentioned answer? Can I expect performance or battery problems?

Community
  • 1
  • 1
Georgi
  • 674
  • 7
  • 21
  • I'm wondering why did they even go with this algorithm, instead of doing what you proposed. It seems so much simpler. Just take the first 20 closest ones. – michal.ciurus Jan 16 '15 at 15:08

0 Answers0