Update create_gpx_tracks.py
This commit is contained in:
1 parent
36a74f1644
commit
8c7724ecb9
1 file changed
+9
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user