Update create_gpx_tracks.py

This commit is contained in:
Tabledevil
2025-03-05 20:38:35 +01:00
parent 36a74f1644
commit 8c7724ecb9

View File

@@ -168,7 +168,15 @@ def process_timeline_json(input_file):
if not points:
continue
output_file = f"track_{date}.gpx"
# Extract year and month from date (format: YYYY-MM-DD)
year, month, _ = date.split('-')
# Create directory structure
dir_path = os.path.join(year, month)
os.makedirs(dir_path, exist_ok=True)
# Update output file path
output_file = os.path.join(dir_path, f"track_{date}.gpx")
print(f"Creating {output_file} with {len(points)} trackpoints...")
# Sort points by timestamp