Locus Map - forum

Support => Troubles & Questions => Topic started by: Michael Niestegge on October 04, 2013, 08:39:06

Title: Missing speed in gpx file
Post by: Michael Niestegge on October 04, 2013, 08:39:06
Good morning,

since the last update, my cadence/speed sensor (Garmin) thankfully works again. But now the information about the current speed given by the sensor is missing in the gpx file? The old version of locus exported it in the <speed> tag, which is not standard:

Code: [Select]
<trkpt lat="52.079580" lon="6.795026">
<ele>89.15</ele>
<time>2013-08-21T17:38:46Z</time>
<pdop>9.00</pdop>
<course>250.900</course>
<speed>4.52</speed>
<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:cad>12</gpxtpx:cad>
</gpxtpx:TrackPointExtension>
</extensions>
</trkpt>

The new locus does not have this tag anymore?

Code: [Select]
<trkpt lat="52.031137" lon="7.838507">
<ele>95.33</ele>
<time>2013-10-03T07:29:35Z</time>
<pdop>5.00</pdop>
<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:cad>96</gpxtpx:cad>
<gpxtpx:hr>165</gpxtpx:hr>
</gpxtpx:TrackPointExtension>
</extensions>
</trkpt>

How can I get the sensor speed? Because the gps speed is very inaccurate
Title: Re: Missing speed in gpx file
Post by: Menion on October 04, 2013, 08:49:07
Hello Michael,
  you wrote that speed tag in previous versions was "not standard". This is also a reason why I removed it. But exists and "standard" alternative for this? Because I wasn't able to find any ...
Title: Re: Missing speed in gpx file
Post by: Michael Niestegge on October 04, 2013, 09:13:11
Speed was a tag in gpx 1.0 but removed with gpx 1.1. It was removed because you can calculate speed by the given coordinates...I think they missed the usage of accurate speed in cycling for example...
Is it a drawback to keep the speed tag, even being not standard? Another possibility would be using gpx 1.0 instead of 1.1. A solution would be great, because I use your software as cycling computer :-)

Edit: Maybe the <extensions> tag is the way to go? I saw some solutions using it to store nmea informations.
Title: Re: Missing speed in gpx file
Post by: Menion on October 04, 2013, 09:44:17
I know, <speed> is used if you export GPX in 1.0 from Locus.

If you remember, in previous versions was checkbox "Compatible with Garmin", where I during export, removed some tags, because they caused some problems with Garmin devices and software. So I wanted to keep export to GPX as much standartized as possible ...

anyway you're using some own post processing? If it has sense, if I put speed from sensor to some <locus:senSpeed> tag ...
Title: Re: Missing speed in gpx file
Post by: Michael Niestegge on October 04, 2013, 09:52:45
I export the gpx-file to Trainingstagebuch.org directly out of locus. As mentioned in my editing of my previous post: Maybe you could add some kind of tag inside a <extensions> tag? I think this best way to get a valid gpx-1.1 file and include the ant+-speed in it?
Title: Re: Missing speed in gpx file
Post by: Menion on October 04, 2013, 10:06:40
yes, I can do this like here

Code: [Select]
<trkpt lat="50.171034" lon="14.651464">
<ele>270.21</ele>
<time>2013-09-07T12:04:21Z</time>
<pdop>5.00</pdop>
<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:cad>50</gpxtpx:cad>
<gpxtpx:hr>104</gpxtpx:hr>
</gpxtpx:TrackPointExtension>
<locus:TrackPointExtension>
<locus:senSpeed>0.0</locus:senSpeed>
<locus:senStrides>0.0</locus:senStrides>
</locus:TrackPointExtension>
</extensions>
</trkpt>

but will this has some sence if no program will be able to read and display these values?
Title: Re: Missing speed in gpx file
Post by: Michael Niestegge on October 04, 2013, 10:50:11
I would write an email to the developer of trainingstagbuch.org. In the past he was very friendly an quick in implementing new thins into his import. Maybe he would also add this extension to his code. I will take your example and send it with my mail. I will post his response here.

Edit: Ticket (German): https://trainingdiary.zendesk.com/requests/56991
Title: Re: Missing speed in gpx file
Post by: jusc on October 04, 2013, 11:18:31
Of course the exported gpx files are readable with other programs, but are they really version GPX 1.1?
If I test them with a GPX validator  from http://www.topografix.com/gpx_validation.asp I get a lot of error messages.
(Sax2Count.exe -v=always -n -s -f my_gpx_file.gpx)

Title: Re: Missing speed in gpx file
Post by: Menion on October 04, 2013, 11:54:35
hmm and what do your
Code: [Select]
Sax2Count.exe -v=always -n -s -f my_gpx_file.gpx??

Because, yes it throws quite a lot of errors, but also errors like

Code: [Select]
Error at file e:\_dev_temp\GPXs\xerces-c-3.1.1-x86-windows-vc-10.0\bin/2013-09-0
7_14-02-44.gpx, line 4236, char 28
  Message: attribute 'lon' is not declared for element 'trkpt'

If I run validation by command on link you provided, then result is correct (this just mean that XML file is correctly formated)

(http://s16.postimg.org/s21c74x1d/2013_10_04_11_52_52_C_Windows_System32_cmd_exe.jpg) (http://postimg.org/image/s21c74x1d/)
Title: Re: Missing speed in gpx file
Post by: Michael Niestegge on October 04, 2013, 13:15:02
Got the feedback from Nils, who is the developer of trainingstagebuch.org:

He implemented it the way you showed it in the example, but he, and me also, has no idea, what the <Locus:SenStrides>-Tag is meant for? Furthermore Nils suggests that it would be a great idea to add the distance to the <Extensions>-Tag.
Title: Re: Missing speed in gpx file
Post by: jusc on October 04, 2013, 14:33:05
hmm and what do your
Code: [Select]
Sax2Count.exe -v=always -n -s -f my_gpx_file.gpx??

Because, yes it throws quite a lot of errors, but also errors like

Code: [Select]
Error at file e:\_dev_temp\GPXs\xerces-c-3.1.1-x86-windows-vc-10.0\bin/2013-09-0
7_14-02-44.gpx, line 4236, char 28
  Message: attribute 'lon' is not declared for element 'trkpt'

If I run validation by command on link you provided, then result is correct (this just mean that XML file is correctly formated)

(http://s16.postimg.org/s21c74x1d/2013_10_04_11_52_52_C_Windows_System32_cmd_exe.jpg) (http://postimg.org/image/s21c74x1d/)

Maybe there is nothig to do. But I read in the German Naviboard, (http://www.naviboard.de/vb/showthread.php?t=55806) that for using GPX files with Garmin devices, It seems to be neccessary that the order of the elements in this file must be hold, and you can test it with this tool.

Another point is, that I export automatically my tracks to gpx files and where is the speed tag already included:
Code: [Select]
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<gpx version="1.0" creator="Locus Android"
 xmlns="http://www.topografix.com/GPX/1/0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:locus="http://www.locusmap.eu"
 xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<trk>
<name><![CDATA[2013-10-03 10:43:30]]></name>
<desc><![CDATA[2h:39m:38s | 39.1 km

Länge - 39.1 km
Punkte (POI) - 1506
Erstellt - 2013-10-03 10:43:42
Max. Geschwindigkeit - 40.8 km/h
Min. Höhe - 60 m
Max. Höhe - 143 m
]]></desc>
<trkseg>
<trkpt lat="52.130589" lon="7.399769">
<ele>71.80</ele>
<time>2013-10-03T08:43:42Z</time>
<pdop>10.00</pdop>
[b]<speed>0.25</speed>[/b]
<course>202.000</course>
</trkpt>
<trkpt lat="52.130636" lon="7.399775">
<ele>66.42</ele>
<time>2013-10-03T08:43:48Z</time>
<pdop>35.00</pdop>
<speed>0.19</speed>
<course>172.000</course>
</trkpt>



So I wonder a bit that that Michael can´t find it....
Title: Re: Missing speed in gpx file
Post by: Michael Niestegge on October 04, 2013, 14:47:33
Quote
Another point is, that I export automatically my tracks to gpx files and where is the speed tag already included:
Code: [Select]
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<gpx version="1.0" creator="Locus Android"
 xmlns="http://www.topografix.com/GPX/1/0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:locus="http://www.locusmap.eu"
 xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<trk>
<name><![CDATA[2013-10-03 10:43:30]]></name>
<desc><![CDATA[2h:39m:38s | 39.1 km

Länge - 39.1 km
Punkte (POI) - 1506
Erstellt - 2013-10-03 10:43:42
Max. Geschwindigkeit - 40.8 km/h
Min. Höhe - 60 m
Max. Höhe - 143 m
]]></desc>
<trkseg>
<trkpt lat="52.130589" lon="7.399769">
<ele>71.80</ele>
<time>2013-10-03T08:43:42Z</time>
<pdop>10.00</pdop>
[b]<speed>0.25</speed>[/b]
<course>202.000</course>
</trkpt>
<trkpt lat="52.130636" lon="7.399775">
<ele>66.42</ele>
<time>2013-10-03T08:43:48Z</time>
<pdop>35.00</pdop>
<speed>0.19</speed>
<course>172.000</course>
</trkpt>



So I wonder a bit that that Michael can´t find it....

Which version of locus pro do you use? Mine is 2.16.0. Older versions had the <speed> and <course> tag, but it is gone in the newest version.
Title: Re: Missing speed in gpx file
Post by: jusc on October 04, 2013, 15:02:49
I use 2.16.0 too, export format is GPX and not Trainingstagebuch.org
Title: Re: Missing speed in gpx file
Post by: Menion on October 04, 2013, 15:50:45
it depend on gpx version. speed is in v1.0, but isn't in v1.1
Title: Re: Missing speed in gpx file
Post by: Michael Niestegge on October 04, 2013, 15:58:20
I use 2.16.0 too, export format is GPX and not Trainingstagebuch.org
Ah ok. As Menion said, it depends on the gpx-Version. I suggest you selected 1.0.

@Menion: Perhaps you didn't read it ;) :

Got the feedback from Nils, who is the developer of trainingstagebuch.org:

He implemented it the way you showed it in the example, but he, and me also, has no idea, what the <Locus:SenStrides>-Tag is meant for? Furthermore Nils suggests that it would be a great idea to add the distance to the <Extensions>-Tag.
Title: Re: Missing speed in gpx file
Post by: Menion on October 05, 2013, 10:24:58
yes I read it ... what I shown, was just possibility, not a final solution. I'm really not a big fan of creating some "locus:" specific tags. If there should be any already working existing solution, I'll gladly use it.

btw. by senStride, I though number of strides reported for example by this sensor http://www.thisisant.com/directory/micoach-stride-sensor , which Locus may use also
Title: Re: Missing speed in gpx file
Post by: Michael Niestegge on October 07, 2013, 07:09:37
Garmin also uses extensions for speed and course:

<gpxtpx:speed>1.37</gpxtpx:speed>
<gpxtpx:course>0.00</gpxtpx:course>

Wouldn't it be a good idea to add these as you are using them for cadence and heartrate?

Link to the XSD: http://www8.garmin.com/xmlschemas/TrackPointExtensionv2.xsd
Title: Re: Missing speed in gpx file
Post by: Menion on October 08, 2013, 22:52:46
ah perfect, I completely missed this ... speed added
Title: Re: Missing speed in gpx file
Post by: Michael Niestegge on October 09, 2013, 07:50:52
ah perfect, I completely missed this ... speed added
Perfect! Cant wait to get the update.  ;D