Does setting "activityType" make sense?

I'm wondering if setting the correct activityType after initializing CLLocationManager will make the location results more accurate.

locationManager = CLLocationManager()
locationManager.distanceFilter = 20
locationManager.activityType = .fitness

Yes it does. activityType determines how CoreLocation will handle raw location data before transferring it to the app.

Two main things that this effects are:

  • correcting the location data to known roads (for navigation, and also fitness), expecting unusual movements (airborne), and so on. If the activity type matches the type of movements, the results will be more accurate. If you require uncorrected data as it comes, the choose default
  • determining when to automatically stop updates (in the old API) and when to set/unset “stationary” (in the new API).

So, yes, this is a meaningful property.


Argun Tekant /  DTS Engineer / Core Technologies

We experience a lot of "Map Matching" or "Snap to roads" lately. Is there a clear overview of which activityType or config should be used to avoid this?

We tried both otherNavigation and Other, however both of them will snap the GPS track to the nearest roads...

For tracking 4x4 off-track drives this is highly undesirable...

Does setting "activityType" make sense?
 
 
Q