nipponalba | pleroma

Thinking about how I pull all of the calculations from a multi-marker GPX file that I might want to display on a webpage..

The file contains start time then multiple track segments with latitude, longitude, elevation, speed and time elements in each.

For total distance I'd need to figure out how to measure between the coordinates and elevations of each consecutive segment (?) and then total each of these.

Duration should be easy, it's just the difference between the first and last timestamp - though modifications are probably required for pauses.. however those are measured..

Pace, I gather would be duration divided by distance.. my quick calculations on this aren't exactly the same as the apps, but presumably this is down to number of decimal places being used in the calculations..

Which leaves calories burned.. this will require a constant for my weight but other than that I've no idea..

Then output all of that into a yaml file for Hugo to render..

Seems like a big job.. I wonder if there is a Linux command line tool that can do all of this already?

These are the steps I may need to take to avoid google and JavaScript..


progress being made.. I just need to find the calculation for calories burned and I think I'll be able to script this all. I think..

Managed to get this sorted by creating a bash script to gpxinfo from gpxpy which gives 3D duration and some other stats to base calculations from, found a formula for calories burned based on MET scores, a tool called gpx2png (I think), mogrify to convert to jpg, resize and create a thumbnail and some gpx direct reading in order to populate a yaml file and push to my site..

I wasn't unhappy with the manual process but my wife wanted me to incorporate it into her site but without all of the manual steps.. so now she can finish her exercise, save the gpx file to a nextcloud directory and I'll kick the script off to update her website.. not exactly automated but also a home-made solution that doesn't involve Google's data centre's or running JavaScript on the sites.. nice!