pbogre / jetlog

Personal flight tracker and viewer
https://github.com/pbogre/jetlog
GNU General Public License v2.0
207 stars 10 forks source link

Use updated ICAO airport codes #54

Open moshobo opened 4 weeks ago

moshobo commented 4 weeks ago

There are a few airports that have updated their ICAO airport code, but JetLog doesn't show the updated version. In my case, I have flights to Kenneth Kaunda International Airport in Lusaka, Zambia. The current ICAO code is FLKK, but jetlog currently uses FLLS.

I took a look at the airports database source and when viewing the raw csv file, it appears that the old ICAO code FLLS is the ident value for this airport. However, the gps_code value is FLKK, the new ICAO code. I assume this is the case so that there aren't any duplicate entry rows as existing airports are renamed. Instead the new ICAO code just gets put in gps_code.

I propose that if a gps_code exists the UI should use it instead of the ident (aka the old ICAO code). It appears that this is how OurAirports seems to handle it too. Here's the example for the airport in my example; notice how the URL is FLLS but the page text shows the new FLKK (example link). Implementation wise, I'm not sure if its best to change the existing icao to be similar to OurAirport's ident, or just add a new gps_code variable to the AirportModel Class.

pbogre commented 4 weeks ago

Thanks for making me aware of this problem.

Your suggestion is a valid one. I think the way i'll be fixing this is, as you suggest, is to prioritize the gps_code column whenever it is present over the ident column. I might just discard the ident ICAO in those cases, but I'll look into any issues that this could create.