I wanted an easy way to plot an aviation route from airport to airport on an interactive web page map. I'm currently using this to track a tour to circumnavigate the world in Microsoft Flight Simulator 2020. Feel free to use or modify this script.
This Python script reads airport data from a CSV file and plots a route on a map using the Folium library. The route is specified by a list of ICAO codes provided in a text file.
- Python 3
pip
(Python package installer)
-
Clone the repository:
git clone https://github.com/your-username/airport-route-plotter.git
-
Navigate to the project directory:
cd airport-route-plotter
-
Install required dependencies:
pip install folium
-
Use the included (
airports.csv
) containing airport data. The CSV file should have the following columns:ident
,latitude_deg
, andlongitude_deg
. -
Updated file available at https://ourairports.com/data/
Example CSV format:
"id","ident","type","name","latitude_deg","longitude_deg","elevation_ft","continent","iso_country","iso_region","municipality","scheduled_service","gps_code","iata_code","local_code","home_link","wikipedia_link","keywords" 6523,"00A","heliport","Total RF Heliport",40.070985,-74.933689,11,"NA","US","US-PA","Bensalem","no","K00A",,"00A","https://www.penndot.pa.gov/TravelInPA/airports-pa/Pages/Total-RF-Heliport.aspx",, 323361,"00AA","small_airport","Aero B Ranch Airport",38.704022,-101.473911,3435,"NA","US","US-KS","Leoti","no","00AA",,"00AA",,,
-
Create a text file (
current_route.txt
) with your route containing a list of Airport ICAO codes, with each code on a new line.Example text file:
KJFK EGLL RJTT ZBAA
Run the script using the following command:
python airport_route_plotter.py
The script will read the airport data from airports.csv and the list of ICAO codes from current_route.txt, then plot the route on a map using Folium.
The resulting map will be saved as route_map.html in the project directory. Open this with your browser.