Sorry I didn't see the your post for a couple of days.
The haversine Formula:
It's for a project for X-Plane, a Flight Simulator. X-Plane has about 38,000 Airports. The current data record for an airport requires the City, Country and FAA Regional code placed in the data record. However, the older airports are grandfathered in and a lot don't contain the City, Country and FAA Regional code info.
I have extracted the following from the airport records: Apt.DAt file 7.9 Million records
1 2 3 4 5 6 7 <---- Field
[00CA][7826300][Nil][NIL][Nil][35.349333][-116.893333] <----Data Record
Field: 1 Airport, Field: 2 Hash into the 7.9 million file, Field: 3 City
Field: 4 Country, Field: 5 FAA Regional Code, Field: 6 Airport Latitude, Field: 7 Airport Longitude
Of the 38,000 records about 17,000 are incomplete and 16,000 records are complete.
[KPHX][7566353][Phoenix][United States][K7][27.23342633][-80.97485154]
I have a demo partially working with the Haversine Formula:
Give it two locations and it will give you the distance between the two.
If I take the 16,000 complete records and do a haversine between the good records and one of the incomplete records I can at a min. determine the Country, FAA Regional Code and possibly the city.
Short answer: Validate some data records for a Flight Simulator.
I'm retired also.