The best way to control a large (50,000+) number of regions

I want to create an application that performs a specific action when a user enters a specific area.

Since the regions that I want to control are on the server side (about 50,000 locations), and the number of regions is too large to register for monitoring right away, I want to start monitoring for regions that are close to the user's current location.

To do this, I’m thinking of using startMonitoringSignificantLocationChanges to check if the user has changed the location, and then use locationManager:didUpdateToLocation:fromLocation: register new regions to monitor and unregister regions that are now too far away.

My questions:

  • Let me call the web service in didUpdateToLocationwhile the app is in the background?
  • Is this the best way to implement such functionality, or do you know the best way?

Thank.

+5
source share
1 answer

What you want is a space filling curve, for example a z-curve of a hilbert curve. This reduces the 2D problem to a 1D problem, but most likely does not answer your question.

0
source

All Articles