Thread: [Gpsbabel-misc] Gpsbabel and 1.4.2 and 1.4.4 incorrectly handling gpxtpx extensions?
Brought to you by:
robertl
From: Angel J. G. A. <ang...@eh...> - 2013-02-21 11:07:18
|
Hi all, I've noticed recently that gpsbabel behaves weird when dealing with some garmin extensions (heart rate in my case) in gpx files. Typically, each node in my input gpx file looks like this: <trkpt lat="42.86463333333333" lon="-2.7025183333333334"> <ele>573.6</ele> <time>2013-02-20T20:55:18.16</time> <extensions> <gpxtpx:TrackPointExtension> <gpxtpx:hr>92</gpxtpx:hr> </gpxtpx:TrackPointExtension> </extensions> </trkpt> Since my gps unit has a very high acquisition rate (that's a matter for another question to the forum some other day...), I usually filter them to get more manageable files. The command I use is: gpsbabel -i gpx -f input.gpx -x position,distance=1.5m -o gpx -F output.gpx The problem is that the resulting node looks like this: <trkpt lat="42.864633333" lon="-2.702518333"> <ele>573.600000</ele> <time>2013-02-20T20:55:18.160Z</time> <extensions> <gpxtpx:TrackPointExtension> 92 </gpxtpx:TrackPointExtension> </extensions> </trkpt> I guess everybody notices the missing <gpxtpx:hr></gpxtpx:hr> pair surrounding the heart rate extension. I have tried directly converting a gpx file into another gpx file without any filtering and all the options of the gpx module that I thought were relevant (garminextensions, gpxver, and even humminbirdextensions); the result, unfortunately, is always the same. I'd really appreciate if anybody could shed some light on this issue. Thanks in advance. Best, Angel |
From: Angel J. G. A. <ang...@eh...> - 2013-02-25 10:26:26
|
Hi again, I have made some progress identifying where the problem described in my previous e-mail lies so I wanted to share it with everyone. Also, I found a (horrible) hack that yields correct results (at least for my input files, probably it won't work in general). Everything below is for version 1.4.4 of gps babel. The "offending" function is in the file 'gpx.c' and it's called 'fprint_xml_chain'. I don't really know what this function does, but it seems to me that it kind of dumps into the output file everything the rest of functions cannot parse. The problem is that, somehow, it screws garmin extensions (at least the 'heartrate' one, haven't tried others). Therefore, the fix to make it work for my particular input files is easy: in function 'gpx_track_disp' I commented the code /* fs_xml* fs_gpx; */ at the beginning of the function and /* fs_gpx = (fs_xml*)fs_chain_find(waypointp->fs, FS_GPX); if (fs_gpx) { fprint_xml_chain(fs_gpx->tag, waypointp); } */ so that function is not called. There are other instances in which this function is called so I guess for other input files they should be commented out. As I said above: this is a horrible fix, but it works for my particular input files perfectly, so now, if I invoke gpsbabel as gpsbabel -i gpx -f input.gpx -o,gpx,garminextensions -F output.gpx it produces beautiful gpx files with a format identical to the input one. I hope some developer can really fix this thing... Best, Angel On 02/21/2013 12:07 PM, Angel J. Garcia Adeva wrote: > Hi all, > > I've noticed recently that gpsbabel behaves weird when dealing with some > garmin extensions (heart rate in my case) in gpx files. Typically, each > node in my input gpx file looks like this: > > <trkpt lat="42.86463333333333" lon="-2.7025183333333334"> > <ele>573.6</ele> > <time>2013-02-20T20:55:18.16</time> > <extensions> > <gpxtpx:TrackPointExtension> > <gpxtpx:hr>92</gpxtpx:hr> > </gpxtpx:TrackPointExtension> > </extensions> > </trkpt> > > Since my gps unit has a very high acquisition rate (that's a matter for > another question to the forum some other day...), I usually filter them > to get more manageable files. The command I use is: > > gpsbabel -i gpx -f input.gpx -x position,distance=1.5m -o gpx -F output.gpx > > The problem is that the resulting node looks like this: > > <trkpt lat="42.864633333" lon="-2.702518333"> > <ele>573.600000</ele> > <time>2013-02-20T20:55:18.160Z</time> > <extensions> > <gpxtpx:TrackPointExtension> > 92 > </gpxtpx:TrackPointExtension> > </extensions> > </trkpt> > > I guess everybody notices the missing <gpxtpx:hr></gpxtpx:hr> pair > surrounding the heart rate extension. > > I have tried directly converting a gpx file into another gpx file > without any filtering and all the options of the gpx module that I > thought were relevant (garminextensions, gpxver, and even > humminbirdextensions); the result, unfortunately, is always the same. > > I'd really appreciate if anybody could shed some light on this issue. > > Thanks in advance. > > Best, > > Angel > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Gpsbabel-misc mailing list http://www.gpsbabel.org > Gps...@li... > To unsubscribe, change list options, or see archives, visit: > https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc > |
From: tsteven4 <tst...@gm...> - 2013-02-25 13:06:12
|
Angel, Can you supply a small gpx file from your device showing the problem that we could use as a test case? Thanks, Steve On 2/25/2013 2:59 AM, Angel J. Garcia Adeva wrote: > Hi again, > > I have made some progress identifying where the problem described in my > previous e-mail lies so I wanted to share it with everyone. Also, I > found a (horrible) hack that yields correct results (at least for my > input files, probably it won't work in general). > > Everything below is for version 1.4.4 of gps babel. The "offending" > function is in the file 'gpx.c' and it's called 'fprint_xml_chain'. I > don't really know what this function does, but it seems to me that it > kind of dumps into the output file everything the rest of functions > cannot parse. The problem is that, somehow, it screws garmin extensions > (at least the 'heartrate' one, haven't tried others). > > Therefore, the fix to make it work for my particular input files is > easy: in function 'gpx_track_disp' I commented the code > > /* fs_xml* fs_gpx; */ > > at the beginning of the function > > and > > /* fs_gpx = (fs_xml*)fs_chain_find(waypointp->fs, FS_GPX); > if (fs_gpx) { > fprint_xml_chain(fs_gpx->tag, waypointp); > } */ > > so that function is not called. > > There are other instances in which this function is called so I guess > for other input files they should be commented out. > > As I said above: this is a horrible fix, but it works for my particular > input files perfectly, so now, if I invoke gpsbabel as > > gpsbabel -i gpx -f input.gpx -o,gpx,garminextensions -F output.gpx > > it produces beautiful gpx files with a format identical to the input one. > > I hope some developer can really fix this thing... > > Best, > > Angel > > On 02/21/2013 12:07 PM, Angel J. Garcia Adeva wrote: >> Hi all, >> >> I've noticed recently that gpsbabel behaves weird when dealing with some >> garmin extensions (heart rate in my case) in gpx files. Typically, each >> node in my input gpx file looks like this: >> >> <trkpt lat="42.86463333333333" lon="-2.7025183333333334"> >> <ele>573.6</ele> >> <time>2013-02-20T20:55:18.16</time> >> <extensions> >> <gpxtpx:TrackPointExtension> >> <gpxtpx:hr>92</gpxtpx:hr> >> </gpxtpx:TrackPointExtension> >> </extensions> >> </trkpt> >> >> Since my gps unit has a very high acquisition rate (that's a matter for >> another question to the forum some other day...), I usually filter them >> to get more manageable files. The command I use is: >> >> gpsbabel -i gpx -f input.gpx -x position,distance=1.5m -o gpx -F output.gpx >> >> The problem is that the resulting node looks like this: >> >> <trkpt lat="42.864633333" lon="-2.702518333"> >> <ele>573.600000</ele> >> <time>2013-02-20T20:55:18.160Z</time> >> <extensions> >> <gpxtpx:TrackPointExtension> >> 92 >> </gpxtpx:TrackPointExtension> >> </extensions> >> </trkpt> >> >> I guess everybody notices the missing <gpxtpx:hr></gpxtpx:hr> pair >> surrounding the heart rate extension. >> >> I have tried directly converting a gpx file into another gpx file >> without any filtering and all the options of the gpx module that I >> thought were relevant (garminextensions, gpxver, and even >> humminbirdextensions); the result, unfortunately, is always the same. >> >> I'd really appreciate if anybody could shed some light on this issue. >> >> Thanks in advance. >> >> Best, >> >> Angel >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Gpsbabel-misc mailing list http://www.gpsbabel.org >> Gps...@li... >> To unsubscribe, change list options, or see archives, visit: >> https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc >> > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Gpsbabel-misc mailing list http://www.gpsbabel.org > Gps...@li... > To unsubscribe, change list options, or see archives, visit: > https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc |
From: Angel J. G. A. <ang...@eh...> - 2013-02-25 14:28:43
Attachments:
workout.gpx
|
Hi Steve, I have attached a 10 points gpx file that contains the 'hr' garmin extension. Using my 'modified' gpsbabel binary (the one with the call to fprint_xml_chain commented out), it is parsed correctly and the output .gpx works flawlessly in any program I've tried so far. Thanks for your help. Best, Angel On 02/25/2013 02:05 PM, tsteven4 wrote: > Angel, > > Can you supply a small gpx file from your device showing the problem > that we could use as a test case? > > Thanks, > Steve > > On 2/25/2013 2:59 AM, Angel J. Garcia Adeva wrote: >> Hi again, >> >> I have made some progress identifying where the problem described in my >> previous e-mail lies so I wanted to share it with everyone. Also, I >> found a (horrible) hack that yields correct results (at least for my >> input files, probably it won't work in general). >> >> Everything below is for version 1.4.4 of gps babel. The "offending" >> function is in the file 'gpx.c' and it's called 'fprint_xml_chain'. I >> don't really know what this function does, but it seems to me that it >> kind of dumps into the output file everything the rest of functions >> cannot parse. The problem is that, somehow, it screws garmin extensions >> (at least the 'heartrate' one, haven't tried others). >> >> Therefore, the fix to make it work for my particular input files is >> easy: in function 'gpx_track_disp' I commented the code >> >> /* fs_xml* fs_gpx; */ >> >> at the beginning of the function >> >> and >> >> /* fs_gpx = (fs_xml*)fs_chain_find(waypointp->fs, FS_GPX); >> if (fs_gpx) { >> fprint_xml_chain(fs_gpx->tag, waypointp); >> } */ >> >> so that function is not called. >> >> There are other instances in which this function is called so I guess >> for other input files they should be commented out. >> >> As I said above: this is a horrible fix, but it works for my particular >> input files perfectly, so now, if I invoke gpsbabel as >> >> gpsbabel -i gpx -f input.gpx -o,gpx,garminextensions -F output.gpx >> >> it produces beautiful gpx files with a format identical to the input one. >> >> I hope some developer can really fix this thing... >> >> Best, >> >> Angel >> >> On 02/21/2013 12:07 PM, Angel J. Garcia Adeva wrote: >>> Hi all, >>> >>> I've noticed recently that gpsbabel behaves weird when dealing with some >>> garmin extensions (heart rate in my case) in gpx files. Typically, each >>> node in my input gpx file looks like this: >>> >>> <trkpt lat="42.86463333333333" lon="-2.7025183333333334"> >>> <ele>573.6</ele> >>> <time>2013-02-20T20:55:18.16</time> >>> <extensions> >>> <gpxtpx:TrackPointExtension> >>> <gpxtpx:hr>92</gpxtpx:hr> >>> </gpxtpx:TrackPointExtension> >>> </extensions> >>> </trkpt> >>> >>> Since my gps unit has a very high acquisition rate (that's a matter for >>> another question to the forum some other day...), I usually filter them >>> to get more manageable files. The command I use is: >>> >>> gpsbabel -i gpx -f input.gpx -x position,distance=1.5m -o gpx -F >>> output.gpx >>> >>> The problem is that the resulting node looks like this: >>> >>> <trkpt lat="42.864633333" lon="-2.702518333"> >>> <ele>573.600000</ele> >>> <time>2013-02-20T20:55:18.160Z</time> >>> <extensions> >>> <gpxtpx:TrackPointExtension> >>> 92 >>> </gpxtpx:TrackPointExtension> >>> </extensions> >>> </trkpt> >>> >>> I guess everybody notices the missing <gpxtpx:hr></gpxtpx:hr> pair >>> surrounding the heart rate extension. >>> >>> I have tried directly converting a gpx file into another gpx file >>> without any filtering and all the options of the gpx module that I >>> thought were relevant (garminextensions, gpxver, and even >>> humminbirdextensions); the result, unfortunately, is always the same. >>> >>> I'd really appreciate if anybody could shed some light on this issue. >>> >>> Thanks in advance. >>> >>> Best, >>> >>> Angel >>> >>> ------------------------------------------------------------------------------ >>> >>> Everyone hates slow websites. So do we. >>> Make your web apps faster with AppDynamics >>> Download AppDynamics Lite for free today: >>> http://p.sf.net/sfu/appdyn_d2d_feb >>> _______________________________________________ >>> Gpsbabel-misc mailing list http://www.gpsbabel.org >>> Gps...@li... >>> To unsubscribe, change list options, or see archives, visit: >>> https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc >>> >> ------------------------------------------------------------------------------ >> >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Gpsbabel-misc mailing list http://www.gpsbabel.org >> Gps...@li... >> To unsubscribe, change list options, or see archives, visit: >> https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc > |