Beispiel #1
0
    def test_track(self):
        igc = parse('../../test/igc/2015-07-09-Wispile.igc')

        kml = Kml()

        for record in igc.b_records:
            kml.add_point(record)
        #kml.create_track('2015-07-09-Wispile.kml')
        kml.create_line_string()
Beispiel #2
0
def main():
    igc_files = list()
    path = 'data'
    for file in os.listdir(path):
        match = re.match('^[0-9-]{11}([A-Za-z0-9\.-_].*)[-\(]{2}', file)
        if not match:
            raise Exception('filename could not be matched: {}'.format(file))
        pilot_name = match.group(1).replace('_', ' ')
        if file.endswith('.igc'):
            file_path = '{}/{}'.format(path, file)
            print(file_path)
            igc_files.append(parse(file_path, pilot_name))

    with open('all_igcs.pickle', 'wb') as handle:
        pickle.dump(igc_files, handle, protocol=pickle.HIGHEST_PROTOCOL)
Beispiel #3
0
    def test_parse(self):
        igc = parse('../../test/igc/2015-07-09-Wispile.igc')
        self.assertEqual('Michael Mimo Moratti', igc.pilot)
        self.assertEqual('GIN Boomerang 9', igc.glider)
        self.assertEqual('Flytec, Connect 1', igc.instrument)

        analyze(igc)

        self.assertEqual(1047, igc.min_gps_altitude)
        self.assertEqual(2827, igc.max_gps_altitude)
        self.assertEqual(978, igc.min_baro_altitude)
        self.assertEqual(2731, igc.max_baro_altitude)
        self.assertEqual(46.43445, igc.min_latitude)
        self.assertEqual(46.486666666666665, igc.max_latitude)
        self.assertEqual(7.282516666666667, igc.min_longitude)
        self.assertEqual(7.3531, igc.max_longitude)

        self.assertEqual(timedelta(hours=0, minutes=57, seconds=47),
                         igc.flight_duration)
Beispiel #4
0
 def test_xctrack(self):
     igc = parse('../../test/igc/2015-08-07-Fiesch.igc')
     self.assertEqual('Michael Mimo Moratti', igc.pilot)
     self.assertEqual('XCTrack', igc.instrument)
     self.assertEqual('OZONE Delta 2', igc.glider)
Beispiel #5
0
 def test_coordinates_as_list(self):
     igc = parse('../../test/igc/2015-07-09-Wispile.igc')
     print(igc.coordinates_as_json())
Beispiel #6
0
 def test_parse_001(self):
     igc = parse('../../test/igc/150516_Mimo Moratti_01.igc')
Beispiel #7
0
 def test_parse_binary_invalid_file(self):
     igc = parse('../../test/igc/2015-07-09-Wispile.kmz')
     self.assertFalse(igc.valid())
Beispiel #8
0
 def test_parse_invalid_file(self):
     igc = parse('../../test/igc/Invalid.igc')
     self.assertFalse(igc.valid())