TCX and GPX export

HyPhan shared this question 6 months ago
Answered

Using Locus Pro I intended to replace my former Garmin Forerunner with Locus.

A BT4LE HF belt works well (hr data gets recorded). The Audio coach tells me current figures every km (while I would certainly be interested in a good and official support for an Android Wear watch - but dont yet own one..).


But when it comes to export (btw. would be nice if it was possible to specify more than one format for auto-export in a track recording profile) it does not look good.

Using TCX, my target App SportTracks (tried latest version / free version) cannot even read it - no data imported.

Using GPX, I only get the track. While heartbeat data seems to be in there (looking into the xml), it does not get imported. SportTracks seems to offer to import various parts of the file separately using checkboxes, but the checkboxes for everything except GPS track are greyed out.

In addition, there is no lap data (I would expect 1km intervals with times - per default but anyways after specifying them for the audio coach).

Also no cadence and similar - this is probably something that really cannot be recorded with the Smartphone.


So for the moment it seems, Locus cannot fully (or lets say in relevant parts) replace a Forerunner.


Any chance you can fix the TCX export or GPX export to include the heartrate data in a more compatible way?


Thanks!

Comments (11)

photo
1

Have you tried importing the TCX file into another program like Garmin Connect or Runalyze.com? It would reveal if the TCX file cannot be properly imported by many programs or if the problem is limited to some programs.

Alternately, you can attach your TCX file here (as a .zip) and I'll test it with Connect and Runalyze.

photo
1

I am well aware that probably the TCX files work with some other programs, otherwise it would be strange. But then I thought SportTracks is also quite well-known and often-used and should not have big implementation issues that it is to blame for (and of course it had no problems with the Garmin-watch-created TCX files). I would say probably Locus does not write fully correct TCX format and hoped this can be corrected. (or is it not publicly specified by Garmin, only possible by re-engineering?)

If I can help there by trying to import modified TCX files (I could even manipulate my own exported file in a way described to me) just say the word.


Alternatively it would also be OK if the GPX format would be improved so that more of the running-relevant info is included in a way compatible to more programs (in my case SportTracks - of course the question is always which side does it "wrong" in some way, it sure _can_ be SportTracks too).

photo
1

Garmin's Training Center XML file format (TCX) is described here. It also contains links to the TCX schema and its extensions.

https://en.wikipedia.org/wiki/Training_Center_XML

photo
1

According to this the TCX/XML generated by Locus is "well formed and valid" (using an online schema validator).

But thats only the Syntax, probably no program will understand anything that could be written within that schema.

One should probably stay as close to the "original" Format use (by its inventor Garmin) as possible to ensure maximum compatibility.

Comparing a Locus generated TCX with one of my former Forerunner 620, various differences can be noticed.

While Garmin writes an <Activity>, Locus uses a <Course>.

Both contain a lap, but with some differences - and an activity lap contains a track, within a course the track follows the lap.

I managed to change my Locus TCX so that SportTracks was able to import it by doing the following things:


  • changing Courses/Course to Activities/Activity where an Activity must contain attribute Sport="Running"
  • Lap element must contain attribute StartTime="2017-03-16T18:43:49Z"
  • change Name to Id, which must contain a dateTime like '2017-03-16T18:43:49Z'
  • put the closing Lap tag behind the track instead of before it (include Track into Lap)
  • remove BeginPosition and EndPosition elements from the Lap element
  • before the Intensity include a Calories element (if not calculated calories, a zero should work?)
  • after the Intensity include a TriggerMethod element, which is one of a list of strings as defined in the schema, obviously it should denote how multiple laps are triggered (and at the moment Locus does not include multiple laps at all), I used 'Distance'

With all of this the xml was still/again well-formed and valid and could be imported.

Dont know if Menion could consider changing this for the TCX export. Never know if this breaks other programs that now understand the Locus-TCX, but after all thats the way Garmin does things..

Thanks for attention.

photo
1

Good day HyPhan,

thanks for a time you invested into this.

Because as you confirmed, Locus Map exported TCX file is valid, I see no problem that needs to be fixed in Locus Map. Fact, that one web service is able to handle "activity" content only, is not an Locus Map problem, sorry.

There are three possible solutions I see:


  • change behavior in Locus Map to allow export an "activity" tags as well
  • using exporting Sporttracks API for directly export from Locus Map to this service ( https://www.sporttracks.mobi/api/doc )
  • using different web service or any service that allows to re-upload data to this sporttrackers web site

Unfortunately first two options takes some time to make them real and without bigger interest from more users, I can't imagine to realize them now, sorry.

EDIT:


photo
1

Thanks Menion for your response.


I am only interested in imports to the standalone / local SportTracks program (dont want my data in any cloud).

I just voted at the other topic you mentioned.

What is described there suggests there _are_ other programs/services that do _not_ understand the TCX with course data ("so the tcx can be uploaded to Garmin connect and/or other platforms that support tcx", the mentioned example runalyze seems not to be able to import the files too as I understand this?)

The changes I described should not be very difficult to do as an additional export format variation, but of course it is a bit work, no doubt. Thanks for considering.


The other thing would be to find out, why the GPX-included hr data also is not recognized by ST. Maybe I will investigate this further too sometimes.

photo
1

Found out now how to import the GPX including hr data into ST - it's enough to change the xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v2"; to v1 (one char at the end) -- so this probably ST is to blame for.

Its not needed to remove the course-data not supported by v1 schema - so ST does not even seem to validate.

So, I have a fairly quick possibility to get my data imported.

However, interval info as "laps" would be something to include in a TCX activity-based file in the future I guess (or would GPX support "laps" too?).

photo
1

Hello HyPhan,

I firstly wanted to leave this task be, because of a lot of other work to do last weeks ( never-ending fixing of bugs mainly ... ). On second side, export as "Activity" solve also export to Garmin Connect web site and also I see you had a lot of time invested here.


So as I wrote in second topic, idea "Export TCX as activity" will be implemented in next version.

photo
1

Hello Menion,

great news, looking forward to next version :)

photo
1

Worked for me :)

photo
1

This is very good news for me as well :). Thank you for help with this, testing and confirmation!