Backspace Diaries

Mistakes and learnings of an iPhone developer

"Go to Hell" by David Ford. Another one-man looping machine. Absolutely mind-blowing talent.

Detecting Bad CoreLocation Data

CoreLocation can (and will) give you poor location data. Over the course of developingRunMonster, I have become painfully aware of this fact. It turns out, though, that you can detect and discard the most egregiously bad location data using a few simple tests.

When a new point comes in, it is invalid and can be discarded if it matches any of the following criteria:

  • The location is nil.
  • The location’s horizontalAccuracy is < 0.
  • The timestamp of the new location is earlier than the timestamp of the previous location, indicating the points came in out of order.
  • The timestamp of the new location is set to a time before your app was even initialized.

In regards to the last bullet, the CoreLocation framework seems to cache and report points from the last time the GPS unit was used. For instance, if you last ran the GPS in Montana and then open your app in Georgia, the first point could be the last cached point from Montana. If you are running a distance-tracking application, then your app would merrily add thousands of miles to your total distance.

Saket - The Link Master

  • Saket: YAY YAY YAY
  • Saket: that's you!
  • Saket: ( is Khoi Vinh's personal blog)
  • Troy: Awesome!!!
  • Troy: Thanks for all the great links!
  • Troy: I'm getting in the habit of sending all your links to our fyi email list
Flipboard goes beyond the RSS feed and actually grabs from the oriignal content source, in a way that i think is quite illegal, or questionably illegal, but i think it’s interesting because it’s forcing the news organizations to rethink whether it’s enough to give you just a headline and a few sentences in their feed.
Khoi Vinh, speaking in Germany Sep 9, 2010