flight-igc-0.1.0: A parser for IGC files.

Copyright(c) Block Scope Limited 2017
LicenseBSD3
Maintainerphil.dejoux@blockscope.com
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Data.Waypoint

Contents

Description

Provides parsing the IGC format for waypoint fixes. The date header is also parsed as it is needed for the fixes that have only a time and pickup the date in the file header.

Synopsis

Data

data IgcRecord Source #

The record types:

  • A FR manufacturer and identification
  • B Fix
  • C Task/declaration
  • D Differential GPS
  • E Event
  • F Constellation
  • G Security
  • H File header
  • I List of extension data included at end of each fix B record
  • J List of data included in each extension (K) Record
  • K Extension data
  • L Logbook/comments
  • M, N, etc. - Spare

SOURCE: http://carrier.csi.cam.ac.uk/forsterlewis/soaring/igc_file_format/igc_format_2008.html

Constructors

B HMS Lat Lng AltBaro (Maybe AltGps)

A location fix.

HFDTE String String String

The date header record.

Ignore

Any other record type is ignored.

data HMS Source #

A time with hours, minutes and seconds.

Constructors

HMS Hour Minute Second 

Instances

Show HMS Source # 

Methods

showsPrec :: Int -> HMS -> ShowS #

show :: HMS -> String #

showList :: [HMS] -> ShowS #

data Lat Source #

A latitude with degrees and minutes.

Constructors

LatN Degree Minute

North

LatS Degree Minute

South

Instances

Show Lat Source # 

Methods

showsPrec :: Int -> Lat -> ShowS #

show :: Lat -> String #

showList :: [Lat] -> ShowS #

data Lng Source #

A longitude with degrees and minutes.

Constructors

LngW Degree Minute

West

LngE Degree Minute

East

Instances

Show Lng Source # 

Methods

showsPrec :: Int -> Lng -> ShowS #

show :: Lng -> String #

showList :: [Lng] -> ShowS #

newtype AltBaro Source #

Pressure altitude in metres

Constructors

AltBaro Altitude 

Instances

newtype AltGps Source #

GPS altitude in metres

Constructors

AltGps Altitude 

Instances

Parsing Functions

parse Source #

Arguments

:: String

A string to parse.

-> Either ParseError [IgcRecord] 
>>> parse "B0200223321354S14756057EA0024400241000\n"
Right B 02:00:22 33° 21.354' S 147° 56.057' E 244m (Just 241m)

parseFromFile Source #

Arguments

:: FilePath

An IGC file to parse.

-> IO (Either ParseError [IgcRecord]) 
>>> parseFromFile "./YMDCXXXF.IGC"
HFDTE "09" "01" "12"
Ignore
Ignore
Ignore
Ignore
Ignore
Ignore
Ignore
Ignore
Ignore
Ignore
Ignore
Ignore
B 02:00:22 33° 21.354' S 147° 56.057' E 244m (Just 241m)
B 02:00:30 33° 21.354' S 147° 56.057' E 244m (Just 241m)
... plus 994 other B records

Types

type Altitude = String Source #

An altitude in metres

type Degree = String Source #

A whole degree of angle. May have leading zeros. Has no decimal part.

type Hour = String Source #

An hour of time.

type Minute = String Source #

A minute of time or a minute of a degree. If a minute of a degree, the first two chars are whole minutes and the following chars are the decimal part. No decimal point character is included.

type Second = String Source #

A second of time.