17.9 · Cleaning location fixes, choosing geofences, and map geometry
Location data is noisy and the map is a projection; both facts decide whether your feature feels precise or flaky.
Mental model. Treat every fix as a claim with an accuracy and an age, monitor only the regions that matter now, and remember map distances are projected.
Fixes and regions
Filtering a stream and living within 20 regions.
- How do you filter a stream of location fixes: accuracy, age, and implausible jumps?
Every CLLocation has a horizontalAccuracy (radius in metres, negative means invalid), a timestamp, and optional speed and course (also -1 when unknown). The… - How do you geofence 500 stores when an app may monitor only 20 regions at a time?
Monitor a sliding window: keep the 20 nearest candidates registered, and when the user moves (a significant-change wake-up, or a boundary crossing of a larger…
The map plane
Points, rects, spans and the date line.
- How does MapKit’s projected plane behave: map points, metres at different latitudes, and why a rect across the date line is wrong?
MapKit works on a Mercator-like plane of 268,435,456 × 268,435,456 map points covering the world. One metre is a different number of points at each latitude…
More in System frameworks
- 17.1 · UserNotifications, APNs and how a push actually gets delivered
- 17.2 · Core Location and MapKit
- 17.3 · Contacts, Calendar, Photos, HealthKit and Core Motion
- 17.4 · CloudKit, StoreKit 2 and PassKit
- 17.5 · AuthenticationServices and passkeys, Spotlight, Handoff and user activities
- 17.6 · Live Activities, WeatherKit, App Clips and CarPlay
- 17.7 · A checklist for learning any Apple framework
- 17.8 · APNs tokens, payload budgets and notification triggers
- 17.10 · Contacts, EventKit, HealthKit units and sensor availability
- 17.11 · Records, system fields and CKError handling
- 17.12 · Passkey assertions, Apple ID tokens and Live Activity payloads