Code Monkey home page Code Monkey logo

igc4j's Introduction

IGC4J

Build and Test

A simple JVM-based parser for IGC file format.

IGC is widely used by GPS tracking devices and apps used in paragliding, hanggliding and other soaring flight sports.

Format description can be found here

This library supports only a simple subset of IGC records:

  • Flight timestamp
  • Pilot name
  • Glider id
  • Glider type
  • Device manufacturer info
  • List of track points

If you need other IGC records to be parsed - let me know via issues section!

Usage

Configuring Dependency

igc4j can be obtained from jitpack repository

Add this to your build.gradle file:

repositories {
    maven {
        url = uri("https://jitpack.io")
    }
}

After that, you will be able to add igc4j to your dependency list

implementation("com.github.smirnovegorv:igc4j:1.0.0")

Parsing IGC

Parsing IGC file is pretty straightforward:

File igcFile = ...;
IGCTrack track = IGCParser.parse(igcFile);

// We can see some track metadata, since all fields are optional be sure to check for NULLs
String pilotName = track.metadata.pilotName;

// We can iterate over track points
for (IGCTrackPoint point: track.points) {
    System.out.println("Point coordinates: " + point.lat + ", " + point.lon + ", " + point.gpsAltitude);    
}

Each track may contain some metadata values (pilot name, gps tracker device info), all of them are optional and may be included or not depending on tracker device firmware. And it contains a list of points.

Each point has following properties:

  • timestampString - HHmmss format as provided in IGC file
  • timestamp - same as long milliseconds count since start of the day
  • lat, lon - 2d coordinates
  • validity. Special flag, A means this is a valid 3d point, V means 2d only (no GPS altitude)
  • barometricAltitude - height in meters above 1013.25 HPa sea level datum. May be set to zero if track was recorded on a device without barometric altimeter
  • gpsAltitude - altitude in meters above WGS84 ellipsoid, present only if validity is set to A

License

Project is licensed under Apache 2.0 license. See license file

igc4j's People

Contributors

smirnovegorv avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.