Update create_gpx_tracks.py
This commit is contained in:
@@ -168,7 +168,15 @@ def process_timeline_json(input_file):
|
|||||||
if not points:
|
if not points:
|
||||||
continue
|
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...")
|
print(f"Creating {output_file} with {len(points)} trackpoints...")
|
||||||
|
|
||||||
# Sort points by timestamp
|
# Sort points by timestamp
|
||||||
|
|||||||
Reference in New Issue
Block a user