Yo @Elias and Team YoursTruly! Your app is awesome and i’m using it every ride.
For all app users out there, here is a little python script to convert ride debug log to gpx file:
import json
import gpxpy
import gpxpy.gpx
from datetime import datetime
# load json data
with open("path/to/json_file.json", "r") as json_file:
data = json.load(json_file)
# create GPX object
gpx = gpxpy.gpx.GPX()
# create GPX track
gpx_track = gpxpy.gpx.GPXTrack()
gpx.tracks.append(gpx_track)
# create GPX segment
gpx_segment = gpxpy.gpx.GPXTrackSegment()
gpx_track.segments.append(gpx_segment)
# iterate through location data and add to GPX segment
for location in data["minimisedLocationData"]:
latitude = location["latitude"]
longitude = location["longitude"]
elevation = location["altitude"]
timestamp = location["forDate"]
# convert timestamp to datetime object
datetime_obj = datetime.fromtimestamp(timestamp)
gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(latitude, longitude, elevation, time=datetime_obj))
# write GPX to file
with open("path/to/output.gpx", "w") as gpx_file:
gpx_file.write(gpx.to_xml())