Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Control iOS gps input

Tags:

ios

maps

gps

I have a problem with iPhone GPS ; i'm trying to record a track that is not on a street , but each time I pass near a street ( look at enclosed image ) it seems to me that the gps output is corrected with maps data ; Is there a way to disable this beahviour ? I need the precise point in my app

track from iphone

like image 914
atrebbi Avatar asked Apr 19 '13 09:04

atrebbi


1 Answers

To avoid the "snap to road" feature, set the activityType to CLActivityTypeOtherNavigation. All other values (Other, Fitness, AutoNav) for activityType will snap to the nearest road.

This was the advice we received from an Apple engineer at WWDC recently. We also verified this (on iOS 7.1.2) by taking 4 iPhone 5 devices (one for each activityType, plus a Trimble GPS for reference) and doing extensive testing on and off roads (see map below).

We have not tested on iOS 8 yet, this behavior could change, since it is undocumented.

Caution: if there is more than one instance of CLLocationManager in your app, they must be set to the same activityType. If they have different values, the first one started may be the one that determines how they all behave, we had problems with this too. MKMapView creates its own CLLocationManager, for example.

Here is a sample of our test results. The orange line is CLActivityTypeOtherNavigation, the blue, green and red are the other 3 activity types. You can see that the blue, green and red follow the center line of the road, while the orange line uses the raw GPS position.

enter image description here

like image 131
progrmr Avatar answered Oct 16 '22 05:10

progrmr