By golly, it can be hard work testing GPS-enabled apps. I mean if you really want to make sure it’s all working then you’ve gotta travel around and cover a good distance. I found out to my horror the other day that the Targeting Computer was suffering from some distance calculation craziness that I hadn’t spotted before.
Most of the real-world tests I’d carried out covered distances no more than ten kilometres away, and the app seemed to work well within those constraints. However I hadn’t really paid much attention to locations that were quite some distance from me. The Targeting Computer thought famous landmarks such as the Eiffel Tower and Big Ben were just a stones throw from where I live. Believe me they ain’t.
With errors like that there’s absolutely no chance of a rebel pilot navigating his X-wing down the Death Star’s trench and hitting its small thermal exhaust port. In fact they probably wouldn’t even be able to find the Death Star itself!
Anyway, after spending a little time looking at my distance calculation code (it was based on the Haversine formula) I decided the best thing to do was simply look elsewhere for a reliable third-party API that would do it for me. I settled on the Yahoo Maps API and everything seems to be working fine again. I really should have used their API from the start, after all I was already using their PlaceFinder web service to perform the app’s geocoding.
Anyway, all you X-wing pilot wannabes out there can rest easy knowing that if the Galactic Empire ever decides to send the Death Star our way, my Targeting Computer app will ensure we’ll at least be able to find the damn thing.