I used the GPS coordinates for each airport out of airports.json (a common reference file) and wrote a great circle length function. The numbers don't match DL or gcmap.com exactly because the airfield coordinates are slightly different, and my great circle length function might not be perfect either.
The reason it does not show a lounge for the GPT-ATL segment is because there is not a DL lounge in GPT... I used the departure airport for that segment to compute the lounge.
Hopefully with your data points I can fiddle with the MQD computation a bit to make it more exact... my goal was to be within a few dollars.
Thanks, I hope my comments didn't come across as critical, I was just sharing what looked like anomalies on my first try. The lounge thing is tricky because my first reaction would be that you should consider connections too - but then you create a whole bunch of complexity. Maybe, if you are already considering connections to be one arrival + one departure, you could just have an "or" construct for "club exists at departure airport *or* club exists at arrival airport"?
In the case of this trip the output was confusing because there are clubs at both PDX and ATL. Strictly speaking, I could have entered the club at PDX before departure, at ATL on my outbound connection, at ATL on my return connection, and at PDX on arrival.
I think it just illustrates the actual complexity of things when we as user say "Well, Delta should just do such and such". Sure, it's easy to solve
this problem, but you have to consider all of the other problems that the fix is likely to create.