Building a flight-plan creator with Google Cloud Functions and Sheets

The “business” problem

Screenshot from MSFS of me in a Lockheed Electra flying towards central Auckland, New Zealand
Screenshot from FlightRadar24 showing a live flight track

File formats

FlightRadar24 CSV export showing Air New Zealand 1005 on the ground in LAX
Extract from PLN file for the KLAX to NZAA flight
  • The PLN format has the location coordinates in degree-minute-second format
  • The PLN requires the departure and destination airports, including coordinates and elevation (altitude) for these, but the FlightRadar file doesn’t include them
  • The PLN needs a cruising altitude, but the FlightRadar file doesn’t explicitly include this
Creating the root element in xmlbuilder2 for the PLN file

Google Cloud Functions

  • One for guessing the starting and ending airports
  • One for taking the CSV, along with the starting and ending airport IDs (ICAO codes) and converting this to PLN format
Minimal Google Cloud Function

Airport data in a Google Sheet

Fetching data from a Google Sheet with auto-authentication

The front end

My standard scaffolding for the front end
track2plan.apps.cronin.nz

Tidying up

Deployment

Github Actions workflow for Google Cloud Functions
Github Actions workflow for web app on S3 and Cloudfront

Summary and next steps

--

--

--

Technology leader for Xero in Auckland, New Zealand, former start-up founder, father of two, maker of t-shirts and small software products

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Handle Internationalization in Your React App with Lingui

NativeScript Angular: Setup environment.ts for Different Environments

Import Export in REACT

Persistent JavaScript storage with CSV

JavaScript Asynchronous Programming

How to Share React Components Between NextJS Projects

How to Test Your Linked NPM Package before Publish

React Colorful: A Minimalist and Fast Alternative to React Color

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gareth Cronin

Gareth Cronin

Technology leader for Xero in Auckland, New Zealand, former start-up founder, father of two, maker of t-shirts and small software products

More from Medium

Pub/Sub Messaging With Geo Data App Blueprint

Pub-Sub Messaging With Geo Data App Blueprint

Architecture behind a Web Scraper that runs on the AWS Cloud

Autoscaling Unattended RPA with Power Automate

How to Create a Custom AMI with Image Pipeline and Automate its Creation Using EC2 Image Builder