Fix RaisedAttributeError

point.location.latitude and point.location.longitude were not present in the object
pull/129/head
Laeriut 2022-01-25 22:23:42 +01:00 zatwierdzone przez GitHub
rodzic 140a48d3cb
commit a240ed387b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -179,4 +179,12 @@ def igc(address, date):
)
for point in points:
sql = f"""SELECT st_x('{point.location}'::geometry), st_y('{point.location}'::geometry)"""
result = db.session.execute(sql)
for row in result:
point.location.latitude = row[1]
point.location.longitude = row[0]
writer.write_fix(point.timestamp.time(), latitude=point.location.latitude, longitude=point.location.longitude, valid=True, pressure_alt=point.altitude, gps_alt=point.altitude)