Flight Historian Version 2.2: Regions and Flight Lookups

Previously, Flight Historian had offered the ability to show maps with all worldwide flights, or to zoom in to the contiguous United States (CONUS). This had been accomplished by giving all airports an is_conus parameter in the database, which was set to true if the airport was CONUS.

While the majority of my travel was within the US, I’d taken a few trips to other parts of the world, and I wanted to add the ability to zoom in on other regions. I ended up figuring out that I could use airport ICAO codes to identify airports’ regions. Now, Flight Historian has the ability to filter by WorldUSA (CONUS)Europe, and Oceania. If I need to add a region in the future, it’s as easy as adding a single line of code with the name of the region and an array of ICAO prefixes.

Screenshot of Flight Historian, showing the new map region tabs.

New Flight Updates

While my digital boarding pass import release has been immensely successful in saving me time adding flights, it’s not always possible to get a digital boarding pass. Flights that require a seat assignment at the gate, international codeshares, and other sorts of flights can all require a paper boarding pass, which I was unable to import.

However, paper boarding passes still have a PDF417 barcode (which I could scan with a barcode reader app) containing some flight data, so I updated the flight log to support using this Bar Coded Boarding Pass (BCBP) data to pre-populate some new flight fields. Additionally, for situations where I didn’t even have a barcode available, I added the option to search for a flight by airline and flight number.

Flight Historian's "new flight" menu.
I now have four ways to create a flight: emailing a digital boarding pass, scanning a paper boarding pass barcode, looking up an airline and flight number, and manually adding a flight.

However, since the BCBP and flight numbers inherently don’t have as much data as the Apple digital boarding pass, I had to rely much more heavily on looking up information on FlightAware’s FlightXML API. I reworked the entire new flight process to essentially take as much information as it already knew, and use it to look up as much of the remaining information as possible:

Flowchart showing the process for looking up a new flight. Flight Historian takes as much data as is provided from a PKPass, BCBP data, or a flight number, and then looks up the remainder using FlightAware's FlightXML API. If unknown airports, aircraft, or airlines are encountered, a form is displayed allowing it to be created. Once all that is accomplished, a new flight form is displayed, with fields prefilled with data from the previous steps.

Tail Numbers

While US tail numbers are purely letters and numbers (e.g. N909EV), many international tail numbers commonly have dashes in them (e.g., VH-OQI). Previously, I stored the tail number in the database with those dashes present. However, since the dashes are technically optional, I now store the tail numbers in the database with the dashes removed, and I wrote a function to add dashes to tail numbers based on the countries they’re from.



  • FlightXML module for performing lookups on the FlightXML API.
  • ICAO codes to the Airport model.
  • Bar Coded Boarding Pass (BCBP) and flight number lookups to New Flight menu.
  • Tail number formatting method (format) to TailNumber module.


  • Maps can now be filtered by multiple regions (instead of just World and CONUS).
  • Regions are now determined by airport ICAO codes.
  • Moved existing FlightXML lookups to new FlightXML module.
  • Tail numbers are now stored with no dashes, and instead formatted using TailNumber.format.
  • Minor UI and bug fixes.


  • Functionality for updating existing flights with a new PKPass.
  • is_conus boolean from Airport model, since regions are now determined by ICAO code.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s