The bug is explained below via a copy paste of a reddit comment:
This is not correct:
// convertKilometersToMiles converts kilometers into miles. The miles are rounded.
func convertKilometersToMiles(kilometers float64) int {
return int(kilometers / 1.60934)
}
Well, I mean it is, except that the API you’re using requires nautical miles not statute miles.
The ‘miles’ used by Americans and Brits to measure distance on the ground are ‘statute miles’. The distances used historically by boats on the water and adopted by airplanes are measured in ‘nautical miles’ which are 15% larger than statute miles.(*)
(*) well, except in USA aviation weather reports give the visibility in statute miles.
(**) And no doubt there are many more peculiarities in the way USA aviation reports and measures distances.
The divider is 1.852 to convert kilometers to nautical miles.
The bug is explained below via a copy paste of a reddit comment:
This is not correct:
Well, I mean it is, except that the API you’re using requires nautical miles not statute miles.
The ‘miles’ used by Americans and Brits to measure distance on the ground are ‘statute miles’. The distances used historically by boats on the water and adopted by airplanes are measured in ‘nautical miles’ which are 15% larger than statute miles.(*)
(*) well, except in USA aviation weather reports give the visibility in statute miles.
(**) And no doubt there are many more peculiarities in the way USA aviation reports and measures distances.
The divider is 1.852 to convert kilometers to nautical miles.
https://github.com/ADSB-One/api/blob/main/README.md