insert gpx points

This commit is contained in:
Riccardo Berto 2021-02-24 15:58:52 +01:00
parent 800d5151b6
commit 7ec35edcaf

15
main.py
View File

@ -74,7 +74,20 @@ def process_gpx_files(tx: Connection, owner: str):
gpx_file.get_moving_data().moving_distance,
gpx_file.get_moving_data().stopped_distance,)
))[0][0]
for track in gpx_file.tracks:
for segment in track.segments:
for point in segment.points:
db.execute("""
insert into training_data (training_id, t, lat, lon, speed, elevation)
values (?, ?, ?, ?, ?, ?)
""",
(training_id,
point.time,
point.latitude,
point.longitude,
point.speed,
point.elevation,)
)
def main(owner: str):