Copyright | © 2018 Phil de Joux © 2018 Block Scope Limited |
---|---|
License | MPL-2.0 |
Maintainer | Phil de Joux <phil.dejoux@blockscope.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
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 IgcRecord
- data HMS = HMS Hour Minute Second
- data Lat
- data Lng
- newtype AltBaro = AltBaro Altitude
- newtype AltGps = AltGps Altitude
- parse :: String -> Either ParseError [IgcRecord]
- parseFromFile :: FilePath -> IO (Either ParseError [IgcRecord])
- type Altitude = String
- type Degree = String
- type Hour = String
- type Minute = String
- type Second = String
Data
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
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. |
A time with hours, minutes and seconds.
A latitude with degrees and minutes.
A longitude with degrees and minutes.
Pressure altitude in metres
GPS altitude in metres
Parsing Functions
:: 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)
:: 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
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.