Calculate the distance flown for a given itinerary.
go install github.com/asmarques/miles@latest
To calculate the distance for a given itinerary, specify the IATA code of each airport along the route as an argument to miles
:
$ miles LIS EWR SFO EWR LIS
0: LIS EWR 3384 miles
1: EWR SFO 2565 miles
2: SFO EWR 2565 miles
3: EWR LIS 3384 miles
total: 11899 miles
The miles
command supports the following options:
-d
to specify the path to the airport database. If not supplied, the embedded airport database is used instead.-o
choose the output format. Available formats are:text
(default),json
andkml
.-v
to enable verbose output when using thetext
output format. Includes additional airport information such as airport name, country, latitute and longitude.
The airport database (airports.csv
) is obtained from OurAirports.com which is available in the public domain.