Skip to content

Turbo87/igc-parser

Folders and files

NameName
Last commit message
Last commit date
Mar 10, 2025
Jan 6, 2025
Oct 17, 2021
Jan 6, 2025
Jul 17, 2017
Aug 1, 2017
Jan 6, 2025
Jan 6, 2025
Jul 25, 2017
Jan 6, 2025
Feb 28, 2021
Jan 6, 2025
May 8, 2025
May 8, 2025
Jan 6, 2025
Jan 6, 2025
Aug 1, 2017
Aug 1, 2017

Repository files navigation

igc-parser

Build Status

IGC flight log parser

Install

npm install --save igc-parser

or using yarn:

yarn add igc-parser

Usage

const fs = require('fs');
const IGCParser = require('igc-parser');

let result = IGCParser.parse(fs.readFileSync('1G_77fv6m71.igc', 'utf8'));
var x = {
  date: '2017-07-15',
  numFlight: 1,
  
  pilot: 'John Doe',
  copilot: null,

  gliderType: 'ASW 19',
  registration: 'D-2019',
  callsign: '1G',
  competitionClass: 'Club',

  loggerId: '6M7',
  loggerManufacturer: 'LXNAV',
  loggerType: 'LXNAV,LX8080',
  
  task: {
    declarationDate: "2017-07-15",
    declarationTime: "08:57:20",
    declarationTimestamp: 1500109040000,

    flightDate: null,
    taskNumber: 2,

    numTurnpoints: 2,
    comment: "1000km",

    points: [
      {
        latitude: 0,
        longitude: 0,
        name: null,
      },
      {
        latitude: 51.14138333333333,
        longitude: 6.985283333333333,
        name: "006Langenfeld-Wiescheid",
      },
      // ...
    ],
  },

  fixes: [
    {
      enl: 0.04,
      extensions: {
        "ACZ": "100",
        "ENL": "040",
        "FXA": "060",
        "GSP": "00051",
        "OAT": "2400",
        "TAS": "00000",
        "TRT": "650",
        "VAT": "00010",
      },
      fixAccuracy: 60,
      gpsAltitude: 49,
      latitude: 51.0107,
      longitude: 7.010066666666667,
      pressureAltitude: -42,
      time: "10:18:26",
      timestamp: 1500113906000,
      valid: true,
    },
    // ...
  ],
  
  security: '60DC059E2D2F6CAD2E889224E355DBDDB805CAB100000639B49FC5F280A292C990F554789F12381380720000',
}

For more examples have a look at our test suite.

Options

A second options argument can be passed. The lenient option allows parsing to proceed even if some errors are found.

let result = IGCParser.parse(fs.readFileSync('1G_77fv6m71.igc', 'utf8'), { lenient: true });

Similar work

skyhop/Igc - A C# adaption of this IGC parser.

License

igc-parser is licensed under the MIT License.