more accurate takeoff location

pull/52/head
Konstantin Gründger 2016-05-30 19:28:50 +02:00
rodzic 6ab3d1a392
commit 31a1282afc
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -73,7 +73,8 @@ def compute_takeoff_and_landing():
# find possible takeoffs and landings
sq2 = app.session.query(
sq.c.timestamp,
sq.c.location,
case([(sq.c.ground_speed > takeoff_speed, sq.c.location_wkt_prev), # on takeoff we take the location from the previous fix because it is nearer to the airport
(sq.c.ground_speed < landing_speed, sq.c.location)]).label('location'),
case([(sq.c.ground_speed > takeoff_speed, sq.c.track),
(sq.c.ground_speed < landing_speed, sq.c.track_prev)]).label('track'), # on landing we take the track from the previous fix because gliders tend to leave the runway quickly
sq.c.ground_speed,