Locate Tunnel Detection

I use Core Location to rotate on a swivel basis and would like to show a "GPS lost" alert in the tunnels.

The problem is that the following two scenarios look the same for the application:

  • The user goes into the tunnel. GPS updates stop because there is no way to find out where the user is.
  • The user stops at an intersection. GPS updates stop as the user no longer moves.

I need to establish these two situations separately. Ideas?

I tried to look at the property horizontalAccuracy, but sometimes updates completely stop, so there is no new information horizontalAccuracy.

+4
source share
2 answers

Typically, with the CLLocationManager set for better navigation accuracy and without a distance filter, you should receive a location update once per second, even if you stop at an intersection.

If you stop receiving these updates while the motion coprocessor (using CMMotionActivityManager) says that you are still driving, you can conclude that you are in a tunnel (or an underground car park or somewhere with a bad GPS signature).

BTW, GPS updates should not stop when you stop at the intersection, if you have installed distanceFilter = 0and desiredAccuracy = kCLLocationAccuracyBestForNavigationand activityType = CLActivityTypeAutomotiveNavigationetc.

, , , , . CLLocation.horizontalAccuracy 50 300 , GPS/GLONASS, .

+5
+1

All Articles