Пример #1
0
Файл: test.py Проект: jmimo/kml
def main():
    parser = Parser()
    igc = parser.parse('2015-08-13-Lai_Alv.igc')

    kml = Kml()
    for record in igc.records:
        kml.add_point(igc.date, record)
    kml.create('test.kml')
Пример #2
0
    def test_bearing(self):
        kml = Kml('BearingTest', 2500)
        point = Wgs84Point(46.978308, 8.254787)

        step = pi / 12
        bearing = 0

        for n in range(24):
            new_point = point_from_distance_and_bearing(point, 2000, bearing)
            new_bearing = bearing_between_two_points(point, new_point)
            print('step: {}, bearing: {}, calculated bearing: {} to point: {}'.format(n, bearing, new_bearing, new_point))
            self.assertAlmostEqual(bearing, new_bearing, places=4)
            kml.add_point('Bearing', '{}'.format(n), new_point)
            bearing += step
        kml.build('BearingTest.kml')