GPX and KML downloads added to Flight Historian

My Flight Historian has always used Great Circle Mapper for its maps. However, I’ve occasionally had the need to use other map formats, like GPX (used by many of my mapping projects) or KML (used by Google Earth).

A while ago I wrote some internal methods in Flight Historian’s code to let me generate GPX or KML files. However, they weren’t available for public use.

I’ve changed that with a small update today. Every map on Flight Historian now has download links immediately below it for GPX and KML versions of the map.

Travel Heatmap

Heatmap of the world, showing Paul’s time spent in various locations

For my 2010s Decade in Travel post, I manually created a heatmap showing the parts of the United States and world where I’d spent the most time traveling. Since I’ve been playing around with QGIS recently, I went ahead and used it to create a proper heatmap of my travels.

The hotter (more yellow) each area of the map is, the more nights I’ve spent there. The map clearly shows that the majority of my travel is within the United States, with a lot of travel to Kansas, Oklahoma, and Texas in particular. Other especially hot areas are Seattle and Orlando, both of which have had many work and personal trips.

Although the map data only goes through March 2020, it is up to date as of this post – due to COVID-19, I haven’t traveled since March.

Unlucky Gate 13

Map of the United states. Airports with a gate 13 are plotted as green dots. Airports without a gate 13 are plotted as red dots. Airports with all gates below or above 13 are plotted as gray dots.

A year or so ago, I was traveling through Portland, Maine, and noticed the airport had some ground-level gates numbered 11, 12, and 14. Gate 13 was missing.

In retrospect, this shouldn’t have surprised me. Thirteen is considered to be an unlucky number, and many buildings skip their thirteenth floor, but I’d never thought about an airport skipping its thirteenth gate. I started to pay attention, and noticed that many other airports passed over gate 13 as well.

I finally went ahead and researched the gates in every one of the 396 U.S. primary commercial service airports (airports with at least 10000 passenger boardings in 2018) and made a map, split into three categories:

Green: Airports with a gate numbered 13.

Red: Airports without any gates numbered 13.

Gray: Airports whose range of gates doesn’t include 13, so 13 isn’t being skipped. Usually this is because the airport has fewer than 13 gates per concourse, but some airports started their gate numbers higher than 13 as well.

Larger dots on the map represent larger airports.

Interesting Finds

  • There didn’t appear to be any large geographic trends in which cities were more worried about the number 13; the northeast seemed to have a slightly higher ratio of airports skipping 13 to having it, but not by any substantial amount.
  • The smallest airport that has a gate 13 is Flint, Michigan (FNT). The largest airport that skips gate 13 is Denver (DEN).
  • Las Vegas (LAS) did not have a gate 13 in any of its concourses. Since it’s a city known for gambling, I’m not surprised that it would avoid unlucky numbers.
  • A lot of larger airports had gate 13 in some concourses and skipped it in others (BOS and ORD were notable examples). I wonder if there’s some correlation between skipping gate 13 and the year each concourse was built.
  • Some airports skip gate 13, but still have baggage claim 13 (IAD did this). Maybe people aren’t worried about bad luck once they’re off the plane and done with flying for the day.

How I Made the Map

I’ve written up how I made the map on my portfolio website:

https://www.pbogard.com/projects/maps/gate-13

A Decade in Travel: 2010–2019

I started my travel-heavy position at my job in 2009, so the 2010s were the first decade where I really frequently traveled throughout the decade.

Since then, I started tracking my flights in a spreadsheet, then eventually wrote an entire flight logging database website. I learned how to extract history from GPS navigation devices and started logging my driving. I also started tracking hotel stays and a myriad of other travel activities as well.

As a result, I have quite a lot of data built up on my travels over the last decade. For the past seven years, I’ve put together annual end-of-year travel summaries. With the turning of the decade, it seemed to be a good time to make myself a decade travel summary. While there’s a small overlap between the decade and annual summaries, I’ve generally tried to focus the decade summary more on areas that make more sense on a 10-year scale, so even readers of my previous summaries should see some new statistics!

In the Air

From 2010 through 2019, I flew on 824 flights, with a total distance of 555 874 miles (894 590 km).

Flight maps generated by Paul Bogard using the Great Circle Mapper – copyright © Karl L. Swartz

My first international trip of the decade was a business trip to Germany in February 2010, and I finished my international travel with a Nordic vacation in August 2019. In between, I picked another multi-country Europe trip, as well as travel to Canada, Australia, New Zealand, and Japan.

Within the U.S., I’ve now been to every major hub airport, and a lot of minor airports as well.

I somehow managed to visit four German airports (Frankfurt, Munich, Nuremburg, and Berlin) while visiting no more than one airport in any other European country.

Grid showing all new airports visited between 2010-2019, and highlighting the airports first visited each year. Visited 2010-2019: DAY CVG SFO ATL IND SEA ORD CLE JFK LGA STL DFW CLT CHM FRA SAV MCO. First visit 2010: SLC LAS PHX IAD BWI ABI. First visit 2011: AVP TOL DCA. First visit 2012: LAX HNL CHS OKC PHL EWR MSP RAP. First visit 2013: AUS BOS DTW DEN GRK ITO PDX TUL IAH MHT MDW. First visit 2014: ICT TUS FLG LAW SAN SJU. First visit 2015: LIT YVR YYZ SPS COS BNA. First visit 2016: AMA SAT MUC NUE TXL LHR CDG KEF ONT PWM DSM BUR RDU. First visit 2017: OAJ VPS BFL TPA PIA. First visit 2018: SYD PER MEL CHC DUD AKL LBB PVD. First visit 2019: NRT FLL FAY PIT BHM MCI HEL ARN MIA ILM.

I visited 93 airports this decade, 76 for the first time.

Chart with years 2010–2019 on the x-axis and Flights on the y-axis, showing number of flights each year for airlines with at least 20 flights.

When I’m flying for work, contracts with airlines for particular routes drive which airlines I can fly, which means my most-flown airlines change year to year. I started out the decade flying mostly American, ended up primarily United in the middle of the decade, then went back to American by the end.

Chart with years 2010–2019 on the x-axis and Flights on the y-axis, showing number of flights each year for aircraft families with at least 20 flights.

With Dayton as my primary airport, I fly on a lot of regional jets. At the start of the decade, the 50-seat ERJ-145 dominated my flights. By the end of the decade, I was mostly flying the larger 70–90 seat E-170/175/190 and CRJ-700/900 jets.

Node-edge graph showing the routes between airports

My most traveled routes were by far Dayton to Dallas/Fort Worth or Chicago O’Hare. Dayton requires a layover for most of my trips, and most of my flights were on American or United this decade. DFW is American’s largest hub, and ORD is a large hub for both airlines.

Map of flights within single states
Directed graph of intrastate flights

Not counting my two flights that returned to the same airport, I had 42 flights (18 unique routes) between pairs of airports within in a single U.S. state.

On the Ground

I drove approximately 207 331 miles (333 667 km) this decade.

Personal Vehicles154 363 mi248 423 km
Rental Vehicles52 968 mi85 243 km
Total207 331 mi333 667 km
Chart of hotel nights by year. 2019 shows 24765 total miles (15418 personal cars, 9347 rental cars)

2016 far exceeded all my other years for driving, mostly because of my summer project to visit every one of Ohio’s 88 counties.

Map showing 2010-2019 driving routes in the United States and Canada

My driving in the U.S. has generally connected into two large clusters, with a bunch of smaller areas. The largest cluster is based in my home state of Ohio, and it largely extends to places I’ve driven to from home, although that started to overlap a few places I’ve flown to (particularly in the Carolinas). I also have a Texas-Oklahoma cluster, since I started the decade frequently traveling to Dallas and Abilene TX, and ended the decade with a lot of trips to Tulsa and Altus OK.

Map showing 2010-2019 driving routes in Germany and Iceland

Within Europe, though I’ve been to other countries, I’ve only driven in Germany and Iceland.

Map showing 2010-2019 driving routes in Australia and New Zealand

Likewise, I’ve visited other cities in Australia and New Zealand, but Perth and Dunedin were the only areas I drove in. Perth was my first experience driving on the left side of the road – I lived in the UK for three years as a child, but I was not old enough to drive.

Geography

Heatmap of the US and the world, showing overnight stays (excluding home) from 2010 to 2019. The ten hottest areas are Tulsa OK, Orlando FL, Altus OK, Seattle WA, Washington DC, St. Louis MO, Charleston SC, Abilene TX, Wichita KS, and Chicago IL.

I visited a good portion of the United States and some of the world, but quite a bit of my travel was focused in Oklahoma and northern Texas.

My top 10 metro areas (excluding home) by number of nights I’ve stayed there this past decade are as follows:

RankMetropolitan AreaTotal Nights Visited
#1Tulsa, Oklahoma, U.S.97
#2Orlando, Florida, U.S.96
#3Altus, Oklahoma, U.S.71
#4Seattle, Washington, U.S.60
#5Washington, D.C., U.S.55
#6St. Louis, Missouri, U.S.50
#7Charleston, South Carolina, U.S.41
#8Abilene, Texas, U.S.40
Wichita, Kansas, U.S.40
#10Chicago, Illinois, U.S.36

For each year, my most visited metro area (by number of nights stayed):

YearMost Visited Metropolitan Area
2010Washington, D.C., U.S.
2011Washington, D.C., U.S.
2012Charleston, South Carolina, U.S.
2013
(tie)
Charleston, South Carolina, U.S.
Chicago, Illinois, U.S.
Honolulu, Hawaii, U.S.
2014Orlando, Florida, U.S.
2015Orlando, Florida, U.S.
2016Tulsa, Oklahoma, U.S.
2017Tulsa, Oklahoma, U.S.
2018Altus, Oklahoma, U.S.
2019Wichita, Kansas, U.S.
World map showing visited countries. First visit in 2010s: Austria, Iceland, France, Australia New Zealand, Japan, Sweden. Visited in 2010s: United States, Germany, United Kingdom, Canada. Home: United States.

I visited 11 countries this past decade, 7 for the first time. (I also had a layover in Finland this year, but since I did not leave the airport, it’s not counted as a visited country on this map.) Every country in the world that I have ever visited, I also visited at some point this decade.

Trivia

My favorite airport restaurant (and the one I’ve eaten at the most) is Tortas Frontera, with three locations at Chicago O’Hare.

Chart of unexpected overnight stays, with six in 2014, one in 2015, and one in 2018

I’ve generally been pretty lucky with avoiding major travel disruptions, but 2014 was not my lucky year – I got stuck overnight six times due to weather or other flight delays and cancellations. Three times were in Chicago, one was in Baltimore, one was in Orlando, and one was in Charlotte.

I also got stuck overnight in Little Rock in 2015 due to a thunderstorm. In 2018, a series of weather and mechanical delays caused me to miss my connection at DFW and spend the night in Dallas.

In 2015, I had a flight from Wichita Falls to Dallas/Fort Worth, Texas which was cancelled, but the flight was a short enough distance that the airline had a taxi company transport us on a fleet of 10-passenger vans. I even received a boarding pass for that “flight.”

2019 Year in Travel

2019 wasn’t quite a record-setting travel year for me, but it was still among my busiest. Internationally, I got to visit Japan in the winter, and Sweden and Iceland in the summer. Domestically, I spent a lot of time on the east coast and in the Midwest, but somehow managed not to ever make it out to the Pacific time zone.

Hotels

Chart of hotel nights by year. 2019 shows 112 total nights (77 business, 35 personal)

Travel was down slightly this year, but I still ended up spending 112 nights away from home – 77 for work, and 35 for myself. The plurality of my personal nights were for my summer trip to Sweden and Iceland; most of the rest consisted of a lot of short weekend trips or visits to friends and family.

Flights

I ended the year with 106 flights, totaling 74 110 miles (119 268 km).

Flight maps generated by Paul Bogard using the Great Circle Mapper – copyright © Karl L. Swartz

This was my first year with two separate international trips. I had a work trip to Tokyo in February, and a vacation to Stockholm and Reykjavík in August.

The Tokyo trip was my first time trying out American Airlines’ 777 premium economy class; my job only pays for economy flights, but I was able to purchase a same-day upgrade with my own money for a reasonable price on my Dallas to Tokyo flight. For a 13–hour flight, it was pretty much exactly what I needed; lots of extra legroom, a little extra width, and a nice side pocket to keep devices while they’re charging.

I also upgraded to premium cabins for some of the flights on our vacation; we upgraded to business class at check-in on the Finnair Chicago to Helsinki flight, and won a bid on business class upgrades on the Icelandair Reykjavík to Chicago flight.

The Icelandair 757 business class was closer to a domestic first class flight – lots more room, better service, but no lay-flat bed. Since it was a daytime flight, beds weren’t necessary.

The Finnair A330-300 business class had lay-flat beds, which was nice for the overnight flight. However, at 6′5″ (196 cm), I’m too tall for the bed, so I didn’t really sleep any better in the bed than in my AA premium economy seat. I don’t believe that flight had a premium economy option, but for my future long-haul flights, I’ll probably just upgrade to premium economy rather than business since the beds don’t provide me enough extra benefit for the enormous cost difference.

Domestically, I spent a lot of time in the Great Plains (particularly Oklahoma) and the east coast.

Directed graph with airports as nodes and flights as edges. Airport nodes are sized proportional to the number of visits, and flight edges are color coded by airline.

I decided to try a new visualization of how I flew using a directed graph. I wrote a small module for Flight Historian that could convert flights from my database into a GraphML file, then used yEd Graph Editor to convert it to a radial arrangement.

On this graph, each circle is an airport I visited at least once this year, and each arrow is a flight I took this year. (The circular arrow by OKC shows my flight where we took off from Oklahoma City, and had to return to Oklahoma City due to a mechanical issue.)

My busiest routes were between DAY and DFW or DAY and ORD, with strong showings for DAY ⇄ CLT and DAY ⇄ PHL as well. This makes sense, as Dayton is my home airport, these other airports are all American hubs that serve DAY, and American was my most flown airline this year.

In the last few months of the year, I flew a number of trips on Delta, which brought me a decent number of flights between DAY and ATL.

New Airports

Terminal silhouettes of NRT, FLL, FAY, PIT, BHM, MCI, HEL, ARN, MIA, AND ILM

I visited 10 new airports this year.

#87NRTTokyo–Narita, Japan
#88FLLFort Lauderdale, Florida, United States
#89FAYFayetteville, North Carolina, United States
#90PITPittsburgh, Pennsylvania, United States
#91BHMBirmingham, Alabama, United States
#92MCIKansas City, Missouri, United States
#93HELHelsinki, Finland
#94ARNStockholm–Arlanda, Sweden
#95MIAMiami, Florida, United States
#96ILMWilmington, North Carolina, United States

By picking up FLL and MIA this year, I finally visited all of the large hubs in the United States.

New Airlines

Finnair was my only new airline in 2019. As they are a Oneworld alliance member, I was able to use my American Airlines miles to book them for my trip to Stockholm (via a layover in Helsinki).

New Aircraft

I did not fly any new aircraft families in 2019.

Driving

I drove approximately 24 765 miles (39 855 km) in 2019.

Personal Car15 418 mi24 813 km
Rental Vehicles9 347 mi15 043 km
Total24 765 mi39 855 km
Map showing 2019 driving and passenger routes in the United States, Japan, Sweden, and Iceland

Altus (in southwestern Oklahoma) contributed to a lot of my rental driving – it’s not possible to drive directly into Altus, so I’ve flown into a variety of airports in the region (largely Oklahoma City, Dallas/Fort Worth, and Amarillo). I also had one trip where I flew into Kansas City to drive to Wichita, rather than flying into ICT directly.

Similarly, I didn’t have the option to fly directly into Portsmouth, New Hampshire on several trips there this year, which lead to some driving to other New England airports.

I visited Key West and drove the Overseas Highway (the southern terminus of U.S. Highway 1) for the first time this year.

States and Countries

Map of the United States. New Mexico, Delaware, Alabama, Minnesota, and Vermont are labeled "first visit in 2009." Colorado, Kansas, Oklahoma, Texas, Missouri, Illinois, Indiana, Ohio, Kentucky, West Virginia, Virginia, North Carolina, South Carolina, Florida, Pennsylvania, New Jersey, Massachusetts, New Hampshire, and Maine are labeled as "Visited in 2019." Washington, California, Nevada, Arizona, Utah, Wyoming, South Dakota, Iowa, Wisconsin, Michigan, Arkansas, Tennessee, Alabama, New York, Connecticut, Rhode Island, Maryland, and DC are labeled "Visited."

I visited 24 states this year, five for the first time – New Mexico, Delaware, Alabama, Minnesota, and Vermont.

Map of the world. Japan and Sweden are labeled "First visit in 2019." Iceland and United States are labeled "Visited in 2019." Canada, UK, France, Germany, Austria, Australia, and New Zealand are labeled "Visited."

I also visited four countries this year, two for the first time – Japan and Sweden. (I also had a layover in Finland, but since I did not leave the airport, I don’t count it as a visited country for the purposes of this map.)

Frequent Traveler Status

Chart of frequent traveler status in various programs by year. For 2019, American AAdvantage Platinum, Hilton Honors Diamond, and IHG Rewards Club Gold were earned.

For the first time, I earned status with IHG (from a number of Holiday Inn stays), reaching their gold tier. I also maintained my Diamond status with Hilton, and my Platinum status with American.

Superlatives

Map showing a route between Dallas/Fort Worth and Tokyo, a route between Charlotte and Fayetteville, and a marker for Oklahoma City

Map generated by Paul Bogard using the Great Circle Mapper – copyright © Karl L. Swartz

  • My longest two flights were my 6 414 mile (10 322 km) flight between Dallas and Tokyo, and the same route in reverse coming home.
  • My shortest flight took off from and returned to OKC due to a mechanical issue, traveling a net zero distance.
  • My shortest flights that actually went somewhere were my 117 mile (188 km) flight from Charlotte to Fayetteville, North Carolina, and the same route in reverse.
  • I drove at my highest elevation ever (approximately 14 132 feet or 4 307 meters) by driving up Mount Evans via Colorado State Highway 5 – the highest paved road in North America.
    • That’s a higher elevation than my OKC–OKC flight, which only reached 11 076 feet before returning to the airport.

Generating GPX and KML maps with Ruby on Rails

While working on my various projects, I’ve dealt with various types of maps.

My Flight Historian plots flight data using the Great Circle Mapper tool. These maps are simple to generate from my flight data (I just have to pass it a plain text collection of airport codes) and easy to embed in my website. However, because they are static images, they can’t be easily panned, zoomed, or otherwise manipulated in the way that modern map websites and apps can.

A sample Great Circle Mapper map of my flights in 2018.
(Map generated by Paul Bogard using the Great Circle Mapper – copyright © Karl L. Swartz)

On the other hand, my driving maps require too much detail for a single image, so I create them in Google Earth, which lets me manipulate the view as much as I need to. The driving data is a bit more complicated than my flight log data; while my flight log represents the abstract shortest distance straight line between two airports (and thus only requires specifying the airport at each end), a single drive can involve tens of thousands of coordinates that can be joined together, connect-the-dots style, to show the actual driving route taken.

A sample driving data map using Google Earth

Fortunately, all those coordinates are automatically generated and saved by my car’s GPS navigation unit in a file format called GPX (GPS Exchange Format), which is an XML-based file format which contains (among other things) latitude/longitudes sampled, in the case of my particular GPS, once per second.

Sample from a GPX file from a recent trip

Google Earth doesn’t use GPX format (though it can import it); instead, it uses a format called KML (Keyhole Markup Language, from back when Google Earth was Keyhole EarthViewer). KML is also an XML-based format, so conceptually it’s similarly a collection of coordinates that can all be joined together, with its own slightly different style.

The same set of latitudes, longitudes, and altitudes in KML format. (Note that KML reverses the order of longitude and latitude.)

But while GPX and KML can be used to represent complicated route shapes, they don’t have to be. These formats are both just as capable of taking a pair of points on the globe and drawing the shortest line between them. With that in mind, I decided to try to have Flight Historian automatically generate KML and GPX versions of my flight map, which would let me show my flight routes in Google Earth and Google Maps.

Continue reading “Generating GPX and KML maps with Ruby on Rails”

My “Worst” Layovers

Flying out of a smaller city like Dayton, I’m used to having flight layovers on the way to nearly everywhere I travel. While any layover is going to lengthen a trip, one of the most common complaints I hear from traveling companions is when a layover forces them to fly east to go west, or vice versa.

Traveling east (DAY–IAD) to go west (TUL)

[All maps in this post are generated by Paul Bogard using the Great Circle Mapper – copyright © Karl L. Swartz]

I started thinking about a way to quantify how bad a layover was, and ultimately decided that it would be best to compare the sum of the (great circle) distances for each of the flights flown compared to the (great circle) distance of a direct flight from the origin to the destination:

{ratio}_{layover} = \dfrac{distance_1+distance_2+\ldots+distance_n}{distance_\text{direct}}

This would give me a ratio of how much further I flew than I needed to, where a higher ratio would mean a worse layover. A ratio of 2 would mean I flew twice as far as I needed to, a ratio of 3 would mean three times as far, and so on. A ratio of 1 would mean a layover didn’t add any extra distance at all.

My Worst 5 Layovers

Since I keep track of all of my flight data, I can use this ratio to determine my worst layovers.

Note: these layovers are the “worst” in a mathematical sense only –
the ones that add the most distance relative to the shortest theoretical distance. None of these were subjectively bad – the worst in that sense would probably be awarded to some of the weather/mechanical IRROPS that added extra unplanned layovers and days to my travel time. My intent is not to complain that any of the below are bad, but just to come up with an interesting way to quantify some of my flight data.

#5 Worst: Nashville–Charlotte–Dayton

Flown: 697 mi · Direct: 293 mi · Ratio: 2.379

A lot of my bad layovers come from trips that are just on the threshold where either driving or flying could make sense (for me, about a six hour drive). Because these are some of the shortest direct distances I fly, any deviation in the layover tends to greatly increase the length of the trip. In this case, the route was about 2.3 times longer than a direct flight would have been.

#4 Worst: St Louis–Charlotte–Dayton (both directions)

Flown: 944 mi · Direct: 338 mi · Ratio: 2.793

Similarly, St. Louis is right on the drive/fly threshold for me.

There used to be a direct flight between Dayton and St. Louis back when American Airlines was still operating St. Louis as a hub it inherited from TWA, but now it takes a layover to get there. Usually I can at least go through Chicago O’Hare which is more direct (ratio of 1.467), but occasionally I end up having to fly through Charlotte to get a flight at the right time of day.

#3 Worst: Dayton–Dallas/Fort Worth–Boston

Flown: 2,419 mi · Direct: 707 mi · Ratio: 3.421

This is the one that I thought would be my worst layover. I got this trip for free with frequent flier miles, so I wasn’t going to complain too much about the routing, but I’ve always thought this was a pretty ridiculous-looking map.

#2 Worst: Milwaukee–Atlanta–Dayton

Flown: 1,103 mi · Direct: 283 mi · Ratio: 3.898

All I can guess is that it was probably the cheapest flight available when I booked it, and I wasn’t a very experienced traveler at the time.

#1 Worst: Des Moines–Houston–Wichita

Flown: 1,346 mi · Direct: 335 mi · Ratio: 4.018

This is one of my few short trips that didn’t start at home. I had a work trip where I had to be in Des Moines for the first half of the week, and Wichita the second half. Again, it’s about a six hour drive between the two cities, but with as out of the way as this layover turned out to be (more than quadrupling my distance traveled!), I might have been better off driving.

My Best 5 Layovers

#5 Best: Chicago–Toronto–Munich

Flown: 4,561 mi · Direct: 4,517 mi · Ratio: 1.010

While there are nonstop flights available between Chicago and Munich, I booked this route on frequent flier miles and had to take a layover to do so. That said, it only added a percent to the length of the trip (and at least made the transatlantic flight slightly shorter), so it worked out fine.

#4 Best: Dayton–Denver–Burbank

Flown: 1,930 mi · Direct: 1,911 mi · Ratio: 1.010

Dayton doesn’t have any direct flights to west coast airports (in fact, Denver is the longest direct flight from Dayton), so this routing was pretty decent to get to Burbank.

#3 Best: Charleston–Charlotte–Dayton

Flown: 538 mi · Direct: 536 mi · Ratio: 1.004

Normally my job had me flying United when I went to Charleston, so I had a lot of layovers at Washington Dulles. However, my very first return flight from Charleston was right after United had merged their reservation system with Continental. They were having a lot of issues and my flight got cancelled, so United ended up putting me on a US Airways flight through Charlotte, which was a better layover anyway.

#2 Best: Dayton–Chicago–Seattle (both directions)

Flown: 1,955 mi · Direct: 1,952 mi · Ratio: 1.002

This route was what I expected my best layover to be, and it looks like I was only one place off. The stop in Chicago only adds two tenths of a percent to the length of this route.

#1 Best: Chicago–Cleveland–New York

Flown: 738 mi · Direct: 738 mi · Ratio: 1.000

So while obviously a trip with a layover is still going to take longer than a direct flight, this is about the best layover you can get: any increase in distance for the layover is within the rounding error, and the stop didn’t add a single extra mile.

Interestingly enough, this trip section was part of the same trip that had my second-worst layover of Milwaukee–Atlanta–Dayton, shown above.

Methodology

My flight log’s table of flights contains a trip_id and a trip_section number for that trip, and since layovers are going to be contained within trip sections, I needed to first determine every unique trip_id and trip_section combinations in my flight log:

Flight.all.map{|f| [f.trip_id, f.trip_section]}.uniq

Then I used that to create an array of trip sections, each entity of which contained an array of pairs of airport codes (for example, [["DAY","CLT"],["CLT","STL"]]):

.map{|ts| Flight.where(trip_id: ts.first, trip_section: ts.last).order(:departure_utc).map{|f| [f.origin_airport.iata_code, f.destination_airport.iata_code]}}

Once I had that, I used uniq to remove duplicate routes. Since there was no point in evaluating direct flights (e.g., routes with just a single flight), I also used a select block to keep only routes that had more than one flight:

.uniq.select{|f| f.count > 1}

So now that I had a collection of trip sections with layovers, I had to calculate their total distance, and the direct distance between the first flight’s origin and the last flight’s destination.

Every Airport in my flight log has a latitude and longitude stored, and my flight log already has a Route.distance_by_iata(iata1, iata2) method to find the great circle distance between two airport codes (using the haversine formula).

To get the total trip section route distance flown, I used a map command to create an array of trip distances, and a reduce command to sum them (assuming ts is the array of flight airport code pairs in a trip section):

rd = ts.map{|f| Route.distance_by_iata(f.first, f.last)}.reduce(0, :+)

Best distance (direct flight distance) is easier, since I just need to run the distance calculation on the first flight’s first airport, and the last flight’s last airport:

bd = Route.distance_by_iata(ts.first.first, ts.last.last)

So combining these, we can use a map on the collection of trip sections to create an array of hashes of trip section routes, distances, best distances, and ratios:

.map{|ts| rd = ts.map{|f| Route.distance_by_iata(f.first, f.last)}.reduce(0, :+); bd = Route.distance_by_iata(ts.first.first, ts.last.last); {route: ts.map{|f| f.first}.push(ts.last.last).join("-"), route_distance: rd, best_distance: bd, ratio: (rd.to_f/bd.to_f).round(3)}}

And sort it by ratio descending:

.sort_by{|f| -f[:ratio]}

Combining these all into a single statement:

output = Flight.all.map{|f| [f.trip_id, f.trip_section]}.uniq.map{|ts| Flight.where(trip_id: ts.first, trip_section: ts.last).order(:departure_utc).map{|f| [f.origin_airport.iata_code, f.destination_airport.iata_code]}}.uniq.select{|f| f.count > 1}.map{|ts| rd = ts.map{|f| Route.distance_by_iata(f.first, f.last)}.reduce(0, :+); bd = Route.distance_by_iata(ts.first.first, ts.last.last); {route: ts.map{|f| f.first}.push(ts.last.last).join("-"), route_distance: rd, best_distance: bd, ratio: (rd.to_f/bd.to_f).round(3)}}.sort_by{|f| -f[:ratio]}

Running it on my flight log provided me my results:

And for ease of comparison, I decided to convert it into CSV-formatted output so I could import it into Excel:

output.map{|f| puts f[:route] + "," + f[:route_distance].to_s + "," + f[:best_distance].to_s + "," + f[:ratio].to_s + "\n"}

With that, I had all the information I needed to create my 5 best and 5 worst layovers list.

[Edit on 11 Feb 2019: I have now updated Flight Historian so that trip section pages with a layover show the layover ratio.]

2018 Year in Travel

In 2018, I visited Australia and New Zealand, each for the first time. Other than that, my travel was largely similar in nature and quantity to 2017 – frequent routine business trips, with a few weekend vacations thrown in.

Hotels

I stayed in hotels a record 124 nights this year. Business travel was down slightly, but my three-week Australia and New Zealand vacation added a lot of personal hotel nights.

Flights

I ended up flying 109 flights this year, totaling 87,306 miles (140,505 km).

My 2018 flights worldwide
My 2018 flights within the United States

Maps generated by Paul Bogard using the Great Circle Mapper – copyright © Karl L. Swartz

New Airports

I visited eight airports for the first time this year:

#79SYDSydney, New South Wales, Australia
#80PERPerth, Western Australia, Australia
#81MELMelbourne, Victoria, Australia
#82CHCChristchurch, New Zealand
#83DUDDunedin, New Zealand
#84AKLAuckland, New Zealand
#85LBBLubbock, Texas, United States
#86PVDProvidence, Rhode Island, United States

With 86 airports visited to date, I have only 14 to go to reach my goal of visiting 100 airports.

New Airlines

I flew on two airlines for the first time this year:

New Aircraft

I flew on three aircraft families for the first time this year; all three were from my Australia and New Zealand vacation.

Airbus A380
Boeing 787
ATR 72

Aircraft illustrations created by Norebbo

Superlatives

My longest flight was 8,580 miles (13,808 km) from Dallas to Sydney. This 17–hour flight was the longest I’ve ever been on. I also flew my second-longest flight ever this year: 6,516 miles (10,486 km) from Auckland to Los Angeles.

My shortest flight was 139 miles (223 km) from Dallas to Lawton.

Map generated by Paul Bogard using the Great Circle Mapper – copyright © Karl L. Swartz

Driving

I drove approximately 22,587 miles (36,350 km) this year – 11,616 miles (18,694 km) in my own car, and 10,971 miles (17,656 km) in rental cars.

2018 US driving (rental cars in red, my car in blue)
2018 Australia and New Zealand driving

Map tiles by CartoDB, under CC BY 3.0. map data © OpenStreetMap contributors under ODbL

Frequent Traveler Status

This year, I maintained Platinum status with American Airlines and Diamond status with Hilton. I did not earn any other status this year.

2017 Year in Travel

Flights

With 113 total flights, this was a record flying year for me – the first year I’ve ever exceeded 100 flights. My work flights alone this year exceeded my total flights last year.

2017-flights

Hotels

My hotel nights were pretty consistent with the prior three years; I ended the year with 109 total nights.

2017-hotels

New Airports

I only visited five new airports this year, which puts me at a total of 78 airports visited so far.

New Airports 2017
#74OAJJacksonville, North Carolina, United States
#75VPSDestin/Fort Walton Beach, Florida, United States
#76BFLBakersfield, California, United States
#77TPATampa, Florida, United States
#78PIAPeoria, Illinois, United States

Peoria wasn’t a planned visit – we ended up diverting there and deplaning due to weather in Chicago.

Elite Status

I maintained American Platinum and Hilton Diamond this year, and earned Silver status for both United and Marriott.

EOY Status

So, for the first time, I have legitimate Marriott status – my previous Marriott Gold was a reward for having Gold status on United.

Trivia

2016 Year in Travel

Overall, my travel increased slightly this year. Unlike in 2015, my travel was relatively evenly spread throughout the year.

Flights

2016-flights
Map created with Great Circle Mapper

I took 94 flights in 2016, which beat my 2015 record by five flights.

2016-flights

This year, I had 56 flights on business-only trips (my employer paid for all hotel nights), 4 flights on personal-only trips (I paid for all hotel nights), and 34 flights on trips that were mixed business and personal (my employer and I each paid for at least one hotel night).

At my job, we have contracted rates with the airlines, so the flights between two cities have the same cost no matter what day they take place. As a result, we’re allowed to extend business trips by flying there earlier or flying home later, as long as we’re responsible for any expenses incurred on the additional days. I was able to use that benefit a good deal this year, as the chart above indicates.

However, the plurality of those mixed trip flights came from a single trip: my two-week vacation across Europe, from which I ended up having to go straight to a business trip in Tulsa without stopping home first. Thus, I paid for all of the European flights, my employer paid for the flights that took place after I returned to the US, and we each paid for hotel rooms on the appropriate parts of the trip. This led to a trip with 9 flights being considered a mixed trip, which on its own already exceeds the number of mixed trip flights I’ve had in any prior year.

Hotel Nights

2016-hotels

I spent 113 nights in hotels in 2016, up four from the prior year. 71 were business (my employer paid for the hotel) and 42 were personal (I paid for the hotel).

My business travel nights were slightly down this year, but I made up for it with more personal nights. Again, the Europe trip contributed substantially to my personal hotel nights.

New Airports

I visited 13 new airports in 2016:

2016-new-airports
#61AMAAmarillo, Texas, United States
#62SATSan Antonio, Texas, United States
#63MUCMunich, Germany
#64NUENuremberg, Germany
#65TXLBerlin–Tegel, Germany
#66LHRLondon–Heathrow, United Kingdom
#67CDGParis–Charles de Gaulle, France
#68KEFReykjavík–Keflavík, Iceland
#69ONTOntario, California, United States
#70PWMPortland, Maine, United States
#71DSMDes Moines, Iowa, United States
#72BURBurbank, California, United States
#73RDURaleigh/Durham, North Carolina, United States

Elite Status

2016-status

This year, my travel was weighted more heavily toward American Airlines (61 out of 94 flights), so I was able to get AAdvantage Platinum for the first time.

United renewed my MileagePlus Gold status at the end of 2015 even though I didn’t earn it, which meant that I still had Gold benefits through the end of 2016. I didn’t even earn United Silver this year. However, due to United’s partnership with Marriott, because I was still considered United Gold at the end of this year, Marriott renewed my Marriott Rewards Gold Elite status.

I easily earned Hilton HHonors Diamond again this year – I got the required 60 nights by July, and ended the year with 95 nights spent in Hilton properties.

Trivia