Skip to content

igc2kmz is a tool to convert IGC (flight recorder) to KMZ/KML (Google Earth)

License

Notifications You must be signed in to change notification settings

spasutto/igc2kmz

Repository files navigation

igc2kmz

igc2kmz is a tool to convert IGC (flight recorder) to KMZ/KML (Google Earth).

It's aTypescript port of Tom Payne's python tool igc2kmz

The resulting tool is available online here : → igc2kmz.html ← (it can also be used in command line, see below)

igc2kmz is a PWA (Progessive Web App) wich means you can install it and use it offline just like any app on your smartphone (at least on modern android). Just click 'install' in your browser's menu

Visualisation example

Usage

Just go to https://spasutto.github.io/igc2kmz/igc2kmz.html and select an IGC file or drag/drop it in the yellow/greenish zone.

You can also drop :

Click 'Convert' and there it is. The 'tool' icon 🔧 open the options in wich you can customize the behaviours of the KMZ generation. Interactive help is provided in the popup.

Code

For the web : See igc2kmz.html or example.html ('hello world' code), Single Page Application available here (right click and save it to computer/phone)

⚠️ As of now, web version runs on the UI thread and on slow machines or with big flight it can block the page for some time 💥

Command line : build first then on a prompt :

node dist\igc2kmz.cmd.js examples\flight.igc

Upload to Google Earth, voilà!

ℹ️ Note : animations doesn't seem to work on web version of earth, but are ok on desktop version...

Features

Animation

Visualisation example

Glides / thermals visualisation :

Visualisation example

Photos (placed at GPS position)

Visualisation example

XC Score :

computed by igc-xc-score

Visualisation example

Extruded path :

Visualisation example

Task visualization :

XC Track file format (.xctsk)

Visualisation example

Build

Get sources from the repository and install npm dependencies

git clone https://github.com/spasutto/igc2kmz.git
cd igc2kmz
npm install

then

npm run build     # for command line usage
#  or
npm run minify    # for web
npm run buildweb  # for web (development)
#  or
npm run buildnode # for use as library

Reusing

web

build web/minify version first, then see examples/example.html

node

build node version first, copy dist/igc2kmz.js then in a new javascript file :

var igc2kmz = require('igc2kmz');
const fs = require('fs');

var igccontent = fs.readFileSync('examples/flight.igc', { encoding: 'utf8', flag: 'r' });
var outfilename = "output.kmz";
igc2kmz.igc2kmz(igccontent).catch(err => console.log(err)).then(kmz => {
  if (kmz) {
    fs.writeFileSync(outfilename, Buffer.from(kmz), 'binary');
    console.log("output to " + outfilename);
  }
});

Bugs/todo

  • tests
  • versioning
  • worker for web version
  • others tasks formats
  • warnings on fonts via pureimage
  • warning on Buffer() (outdated pngjs of pureimage)
  • get real altitude and correct IGC or convert from QFE