import GPX Speed field

2011-10-07
2013-05-01
  • Tristan RENAUD
    Tristan RENAUD
    2011-10-07

    Hello,
    First of all, thank you for this great software.

    I'm using a GPS Datalogger to log my running sessions (time, distance, speed…). I can import a GPX into Sportstracker.
    But the speed and the distance is not read from the GPX file. Does this is a normal way the software works, or something is wrong with my file ?

    This is an extract of the GPX file :

    <trkpt lat="47.179443333" lon="-1.573975000">
      <ele>134.437900</ele>
      <time>2011-09-25T18:04:55Z</time>
      <course>344.789978</course>
      <speed>2.884012</speed>
      <fix>2d</fix>
      <hdop>4710.765137</hdop>
    </trkpt>
    <trkpt lat="47.179463333" lon="-1.573978333">
      <ele>134.438500</ele>
      <time>2011-09-25T18:04:56Z</time>
      <course>353.536865</course>
      <speed>2.240630</speed>
      <fix>2d</fix>
      <hdop>4710.766602</hdop>
    </trkpt>
    <trkpt lat="47.179483333" lon="-1.573986667">
      <ele>134.438700</ele>
      <time>2011-09-25T18:04:57Z</time>
      <course>344.187347</course>
      <speed>2.313955</speed>
      <fix>2d</fix>
      <hdop>4710.767578</hdop>
    </trkpt>
    <trkpt lat="47.179508333" lon="-1.574001667">
      <ele>134.439200</ele>
      <time>2011-09-25T18:04:58Z</time>
      <course>337.813263</course>
      <speed>3.005522</speed>
      <fix>2d</fix>
      <hdop>4710.769043</hdop>
    </trkpt>
    

    Thank to everyone who could help me.
    Tristan

     
  • jede28
    jede28
    2011-10-09

    Hi Tristan,

    the GPX parser in SportsTracker does not parse speed and distance data at the moment. It only reads the track, the time and the altitude data.
    Other formats support much more data, e.g. the Garmin TCX or the FIT format. You could use a converter tool and try to import your converted files.

    It's also possible to extend the GPX parser to support speed and distance data. Unfortunately your file contains the speed data only, so the distance needs to be calculated with the speed stored in the trkpt element. But I'm not sure whether this is an accurate calculation of the distance, because it's just the recorded speed at this particular moment.
    Do you have more detailed informations on that?

    Bye, Stefan

     
  • Tristan RENAUD
    Tristan RENAUD
    2011-10-11

    Hi Stefan,

    I followed your advice and tried to use the garmin format.

    My datalogger create files in nemea format. I run gpsbabel on my linux box to convert from nemea to Garmin Training Center (tcx). This generate a xml file.
    Then I tried to import that new file with sportstracker, but it give me an error message : "cannot open or analyse the HRM file…" (translated from French to English..)

    I tried severals options with gpsbabel for conversion, but error is still there. I can send you the original file in nemea format, or the converted one in tcx, or whatever you need to help me.

    This is the options used with gpsbabel to convert my file :

    gpsbabel -t -i nmea -f 20110925T155821Z.nmea -x track,move=0d2h0m0s -o gtrnctr,course,sport=Running -F R1.xml
    

    About the GPX file without the distance, maybe an option in gpsbabel could add it… I'll check that tonight.

    Tristan.

     
  • jede28
    jede28
    2011-10-11

    I have no idea out of the box what the incompatibility problem with gpsbabel and TCX format is. I would need an example TCX file for testing it.

    Currently the GPX support in SportsTracker ignores distance and speed data, so it will not help when gpsbabel would output it. If you are a programmer you could extend the GPX parser of SportsTracker to support the distance data. This should not be too hard, other parser implementations of ST are working similar.
    But it's important to add just support for data which corresponds to the GPX format specification.

    Bye, Stefan
    Probably the best solution for your problem would be when you get gpsbabel to convert

     
  • Tristan RENAUD
    Tristan RENAUD
    2011-10-16

    Hi Stefan,

    This is the error displayed when trying to import my TCX file :

    16 oct. 2011 23:04:55 de.saring.sportstracker.gui.dialogs.ExerciseDialog importHRMFile
    GRAVE: Failed to parse exercise file!
    de.saring.exerciseviewer.core.EVException: Failed to read the Garmin TCX exercise file '/home/tristan/Maps/Parcours/R1.tcx' ...
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
            at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
            at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:71)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:81)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:194)
            at de.saring.exerciseviewer.parser.impl.GarminTcxParser.parseExercise(GarminTcxParser.groovy:42)
            at de.saring.sportstracker.gui.dialogs.ExerciseDialog.importHRMFile(ExerciseDialog.java:442)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAction.java:647)
            at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.java:687)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
            at java.awt.Component.processMouseEvent(Component.java:6268)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6033)
            at java.awt.Container.processEvent(Container.java:2045)
            at java.awt.Component.dispatchEventImpl(Component.java:4629)
            at java.awt.Container.dispatchEventImpl(Container.java:2103)
            at java.awt.Component.dispatchEvent(Component.java:4455)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4633)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4297)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4227)
            at java.awt.Container.dispatchEventImpl(Container.java:2089)
            at java.awt.Window.dispatchEventImpl(Window.java:2517)
            at java.awt.Component.dispatchEvent(Component.java:4455)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:649)
            at java.awt.EventQueue.access$000(EventQueue.java:96)
            at java.awt.EventQueue$1.run(EventQueue.java:608)
            at java.awt.EventQueue$1.run(EventQueue.java:606)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
            at java.awt.EventQueue$2.run(EventQueue.java:622)
            at java.awt.EventQueue$2.run(EventQueue.java:620)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:619)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:194)
            at java.awt.Dialog$1.run(Dialog.java:1072)
            at java.awt.Dialog$3.run(Dialog.java:1126)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Dialog.show(Dialog.java:1124)
            at java.awt.Component.show(Component.java:1551)
            at java.awt.Component.setVisible(Component.java:1503)
            at java.awt.Window.setVisible(Window.java:881)
            at java.awt.Dialog.setVisible(Dialog.java:1011)
            at org.jdesktop.application.SingleFrameApplication.show(SingleFrameApplication.java:295)
            at de.saring.sportstracker.gui.STContextImpl.showDialog(STContextImpl.java:58)
            at de.saring.sportstracker.gui.STControllerImpl.addExercise(STControllerImpl.java:226)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAction.java:647)
            at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.java:687)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
            at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
            at java.awt.Component.processMouseEvent(Component.java:6268)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6033)
            at java.awt.Container.processEvent(Container.java:2045)
            at java.awt.Component.dispatchEventImpl(Component.java:4629)
            at java.awt.Container.dispatchEventImpl(Container.java:2103)
            at java.awt.Component.dispatchEvent(Component.java:4455)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4633)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4297)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4227)
            at java.awt.Container.dispatchEventImpl(Container.java:2089)
            at java.awt.Window.dispatchEventImpl(Window.java:2517)
            at java.awt.Component.dispatchEvent(Component.java:4455)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:649)
            at java.awt.EventQueue.access$000(EventQueue.java:96)
            at java.awt.EventQueue$1.run(EventQueue.java:608)
            at java.awt.EventQueue$1.run(EventQueue.java:606)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
            at java.awt.EventQueue$2.run(EventQueue.java:622)
            at java.awt.EventQueue$2.run(EventQueue.java:620)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:619)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
    Caused by: java.text.ParseException: Unparseable date: ""
            at java.text.DateFormat.parse(DateFormat.java:354)
            at java_text_DateFormat$parse.call(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
            at de.saring.exerciseviewer.parser.impl.GarminTcxParser.parseExercisePath(GarminTcxParser.groovy:60)
            at de.saring.exerciseviewer.parser.impl.GarminTcxParser.this$3$parseExercisePath(GarminTcxParser.groovy)
            at de.saring.exerciseviewer.parser.impl.GarminTcxParser$this$3$parseExercisePath.callCurrent(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
            at de.saring.exerciseviewer.parser.impl.GarminTcxParser.parseExercise(GarminTcxParser.groovy:39)
            ... 94 more
    

    I downloaded source code from mercurial and tried to debug with eclipse, but I'm not really confident with java technology… (plus maven, groovy ect…) I don't know where to start and how to debug so I put this in stand by for now.

    If you want to test my TCX file, I can send it to you. Please tell me how I can give it to you (via this forum ? or another way ?).

    Thanks.
    Tristan

     
  • jede28
    jede28
    2011-10-17

    Hi Tristan,

    I would suggest you to file a Bug request with an error subscription. Please also attach the example file there.
    I'll then try to take a look asap.

    Bye, Stefan