Adding Laps to your GPS Tracks

A place for the community to help each other out with getting the most out of the Combine FIT, GPX or TCX files for Strava Upload Tool.
Post Reply
User avatar
fulmar2
Site Admin
Posts: 228
Joined: Wed Nov 25, 2020 4:21 am
Contact:

Adding Laps to your GPS Tracks

Post by fulmar2 »

Today I was on a run using a Garmin Workout. If you know how these work, you're obliged to do the exact workout, and if you wish to deviate from the workout... you can't. I wanted to record a lap and restructure the workout... but I couldn't do that.

When I got home, I added a feature to "insert laps" into your GPS track. This feature is VERY MUCH BETA... but it worked for me today while merging two, non-overlapping files. I hope it helps you, but if it doesn't work, please send me your files for evaluation with a description of what you need.

To begin, first go to the "Edit Points" tool with your file(s) loaded:

Where to find the Edit Points tool in GOTOES|Strava Tools
Where to find the Edit Points tool in GOTOES|Strava Tools
Screen Shot 2021-11-08 at 6.30.38 PM.png (29.91 KiB) Viewed 36764 times

Next, you will want to find the row where you would like to add a lap. Any lap row with a "0" is eligible for automatic lap calculation (we will discuss manual editing of laps below, which is a bit of work).

Click on a ZERO if you want to insert a lap at this timestamp.
Click on a ZERO if you want to insert a lap at this timestamp.

After you click on the zero, the tool will look backwards and forwards to recalculate the time/distance for this lap. It will shorten the length and time of the previous lap, and insert your lap so that the time/distance make it fit before the next lap. Please note that the Lap values are displayed in this format:

time|distance

time is in seconds; distance is in meters.

After the tool has calculated the values, it will insert them and turn the cells that have been changed a green color. You now have inserted a lap!
After the tool calculates the values, the changed fields will turn green.
After the tool calculates the values, the changed fields will turn green.

At the bottom of the table, you can view the changes that were made, and you can even scroll to the rows that were changed (by clicking on the link that represents the row number):

A record of what has been changed in your GPS file once you have added a lap.
A record of what has been changed in your GPS file once you have added a lap.

If you want to change a lap manually, you can click on any non-zero lap value. You will need to make sure that when you enter a value, you use the time|distance format where time is in seconds; distance is in meters. You will get strange results if you don't respect that. Ideally, you will not need to manually edit laps, as this is quite tedious to perform the calculations. The auto-insert lap feature should work for most people. Enjoy, and please let me know if it doesn't work for you.
stefnz
Posts: 1
Joined: Wed May 18, 2022 4:16 am

Re: Adding Laps to your GPS Tracks

Post by stefnz »

Hi, thanks for the help here. However I'm having some problems:

* I've tried to use the "time|distance" format to replace some existing lap data (only the distance was incorrect, so it was easy enough to fix that), but when I type something in the field to replace the existing value, I can only type one value. When I try to enter a "|" character, nothing happens. Is there a special syntax to use here? I tried to use comma, semicolon, ... to no avail. Or is this a bug?

* Given the above was not working, I set the lap data to "0" and then clicked on the zero to use the automatic calculation feature. I then had a sort of rotating "waiting" hourglass overlay graphic, but it never terminated. I waited like 5 minutes then the only thing I could still do was closing the window.

Background: This was about an indoor swimming activity. So no GPS data, just the occasional distance, and then laps (after each pause). The watch I used to record sometime inserted an extra turn (so extra distance). The lap were then wrong. So I deleted the extra distances (turns) and wanted to fix the laps. Maybe the automatic lap feature got crazy because it couldn't make it consistent (several laps were wrong), that's why I tried to enter the data manually.

Thanks for any help.
User avatar
fulmar2
Site Admin
Posts: 228
Joined: Wed Nov 25, 2020 4:21 am
Contact:

Re: Adding Laps to your GPS Tracks

Post by fulmar2 »

Yes, this was a bug!!! It took me quite a while to find the source, but the issue was that I had restricted all of the numeric fields to being numbers/decimals only. Of course, the pipe character ( | ) is a text character, so it was being disallowed. In certain browsers, you would have received a warning (still a bug)... but at least in Safari, it just let you submit without knowing. Thanks very much for bringing this to my attention. I fixed it today.
lonpfrb
Posts: 2
Joined: Wed Sep 07, 2022 9:49 pm

Re: Adding Laps to your GPS Tracks

Post by lonpfrb »

I tried to add Laps as described and found that while the CSV download has a Laps column as the table of track points, the Merged file download has no Lap data nor track segments within the track itself. Please review the attahments for evidence:
1. 12_05_2022 16_27_21.gpx Original GPX from Garmin Venu without any Laps
2. GOTOES_RawData_3388491331937947.csv Raw Data download with track points selected for Lap - 0 and updated automatically
3. GOTOES_3388491331937947.gpx Meged files result without any trkseg nodes, nor Extensions with the Lap attribute
I was hoping that the result would be
<trk> <-- One Track because its mandatory -->
<trkseg> <-- One Segment because its mandatory -->
<trkpt> <-- Many points -->
transformed/split into
<trk> <-- One Track because its mandatory -->
<trkseg> <-- Segment because I chose this Lap split -->
<trkpt> <-- Many points because they are a Lap -->
<trkseg> <-- Segment because I chose this Lap split -->
<trkpt> <-- Many points because they are a Lap -->
<trkseg> <-- Segment because I chose this Lap split -->
<trkpt> <-- Many points because they are a Lap -->
in the expectation that these represent a number of Laps that can be analysed further..
Not being a Strava User, I understand that is your focus however GPX can represent a Lap so that's what I hope for please?
PS: Though the result is valid XML it cannot be imported by Garmin Basecamp which is limiting..
Attachments
12_05_2022 16_27_21.zip
(47.3 KiB) Downloaded 1346 times
User avatar
fulmar2
Site Admin
Posts: 228
Joined: Wed Nov 25, 2020 4:21 am
Contact:

Re: Adding Laps to your GPS Tracks

Post by fulmar2 »

Thanks for your message. As I said in my first post, this tool is in "beta." I can see why it didn't work on your file; you could call it a bug... what I did not anticipate is that people like you might want to add laps to a file that didn't have any to begin with. Therefore, there is no checkbox in the lap "streams". So even though the laps are inserted into the raw data, the tool doesn't realize you want to include them in the output because that checkbox is missing. When I get some time, I'll try and figure out a way to have the iframe tell the parent page if a user adds a first lap to a file. Thanks for bringing it up.
User avatar
fulmar2
Site Admin
Posts: 228
Joined: Wed Nov 25, 2020 4:21 am
Contact:

Re: Adding Laps to your GPS Tracks

Post by fulmar2 »

I added two features. First change is that now you can add Laps to GPX files. Previously, people were only able to add laps to TCX and FIT files. Also, second change is that you can add laps to files that didn't have ANY laps to begin with. That was kind of a bug, but now it is fixed.

Important Note: Strava will not display "laps" if you export as GPX. That's because Laps aren't really a part of the GPX specification. To see laps on Strava, you will need to export as TCX or FIT. Nevertheless, I went ahead and added "<trkseg>" breaks to GPX files in the cases where laps are inserted at the request of user "lonpfrb"
lonpfrb
Posts: 2
Joined: Wed Sep 07, 2022 9:49 pm

Re: Adding Laps to your GPS Tracks

Post by lonpfrb »

Thanks for your generous update. On further research, I agree with your point that trkseg isn't a lap in a GPX, rather TCX or FIT should be used. I have tested again with TCX and the result is much better and shows that your enhancement to enable Laps where they didn't initially exist does useful work. The Activities/Activity/Lap/TotalTimeSeconds is exactly what I need. Thanks. I observe that Activities/Activity/Lap/DistanceMeters is 0 so that's puzzling after the great Lap Auto calculation feature. The Activities/Activity/Lap/StartTime and Activity/Lap/Track are correct.
Thanks again for your speedy and generous response.
Post Reply