NMEA to gpx: data placed in wrong timeslot

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NMEA to gpx: data placed in wrong timeslot

Adrian
Below are the NMEA input, and the gpx output produced by GpsBabel.

GpsBabel 1.5.2 using GUI front end with all options at their default values. Mac OS X 10.9.5.

You can see that all the data except the course and speed, is one timeslot too late in the gpx output. Most of the data from the last point, is not in the output.

$GPRMC,135707.00,A,4526.72772,N,00502.01960,E,160.698,32.00,040815,,,A*5B
$GPGGA,135707.00,4526.72772,N,00502.01960,E,1,6,,424.4,M,,M,,*60
$GPRMC,135708.00,A,4526.76522,N,00502.05332,E,160.445,32.00,040815,,,A*5C
$GPGGA,135708.00,4526.76522,N,00502.05332,E,1,6,,424.2,M,,M,,*63
$GPRMC,135709.00,A,4526.80284,N,00502.08812,E,160.659,32.00,040815,,,A*54
$GPGGA,135709.00,4526.80284,N,00502.08812,E,1,6,,422.2,M,,M,,*62
$GPRMC,135736.00,A,4527.87882,N,00502.67354,E,158.268,6.00,040815,,,A*68
$GPGGA,135736.00,4527.87882,N,00502.67354,E,1,6,,374.9,M,,M,,*6B
$GPRMC,135737.00,A,4527.92688,N,00502.68110,E,158.015,5.00,040815,,,A*6F
$GPGGA,135737.00,4527.92688,N,00502.68110,E,1,6,,369.0,M,,M,,*62
$GPRMC,135738.00,A,4527.97380,N,00502.68734,E,158.015,4.00,040815,,,A*69
$GPGGA,135738.00,4527.97380,N,00502.68734,E,1,6,,363.1,M,,M,,*6E

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0" creator="GPSBabel - http://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/0">
  <time>2015-08-09T01:17:30.138Z</time>
  <bounds minlat="45.445462000" minlon="5.033660000" maxlat="45.465448000" maxlon="5.044685000"/>
  <trk>
    <trkseg>
      <trkpt lat="45.445462000" lon="5.033660000">
        <time>2015-08-04T13:57:07Z</time>
        <course>32.000000</course>
        <speed>82.670197</speed>
      </trkpt>
      <trkpt lat="45.445462000" lon="5.033660000">
        <ele>424.400000</ele>
        <time>2015-08-04T13:57:08Z</time>
        <course>32.000000</course>
        <speed>82.540039</speed>
        <geoidheight>0.0</geoidheight>
        <fix>3d</fix>
        <sat>6</sat>
      </trkpt>
      <trkpt lat="45.446087000" lon="5.034222000">
        <ele>424.200000</ele>
        <time>2015-08-04T13:57:09Z</time>
        <course>32.000000</course>
        <speed>82.650131</speed>
        <geoidheight>0.0</geoidheight>
        <fix>3d</fix>
        <sat>6</sat>
      </trkpt>
      <trkpt lat="45.446714000" lon="5.034802000">
        <ele>422.200000</ele>
        <time>2015-08-04T13:57:36Z</time>
        <course>6.000000</course>
        <speed>81.420090</speed>
        <geoidheight>0.0</geoidheight>
        <fix>3d</fix>
        <sat>6</sat>
      </trkpt>
      <trkpt lat="45.464647000" lon="5.044559000">
        <ele>374.900000</ele>
        <time>2015-08-04T13:57:37Z</time>
        <course>5.000000</course>
        <speed>81.289940</speed>
        <geoidheight>0.0</geoidheight>
        <fix>3d</fix>
        <sat>6</sat>
      </trkpt>
      <trkpt lat="45.465448000" lon="5.044685000">
        <ele>369.000000</ele>
        <time>2015-08-04T13:57:38Z</time>
        <course>4.000000</course>
        <speed>81.289940</speed>
        <geoidheight>0.0</geoidheight>
        <fix>3d</fix>
        <sat>6</sat>
      </trkpt>
    </trkseg>
  </trk>
</gpx>


------------------------------------------------------------------------------
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: NMEA to gpx: data placed in wrong timeslot

Robert Lipe-4
Hi, and welcome.

You're right.  This is something we don't get right.  It has to do with the way we "batch" NMEA sentences together and the sparseness of your NMEA stream.  If you copy the second sentence (GGA @07) above the first sentence, it looks like it works.  If looks like the end of nmea_read() is being satisfied that the first sentence has a location (true) and a time (true) and a time that's different than the previous (which is true, since it's the first) and adding that.  The second sentnce, the GGA, has all of those, but it's at the same time, so we ignore it.  We then end up letting gga_read() populating those additional fields after the add.

This isn't a problem in most NMEA streams because they contain enough jabber that we stay in sync - and that most people won't notice that everything is off one second.


I'll look into it more later in the week, but if you want to tear into the code, I think it's the end of nmea_read() that's leaving the rails; it probably needs to special case that first point.

On Sun, Aug 9, 2015 at 5:43 PM, Adrian <[hidden email]> wrote:
Below are the NMEA input, and the gpx output produced by GpsBabel.

GpsBabel 1.5.2 using GUI front end with all options at their default values. Mac OS X 10.9.5.

You can see that all the data except the course and speed, is one timeslot too late in the gpx output. Most of the data from the last point, is not in the output.

$GPRMC,135707.00,A,4526.72772,N,00502.01960,E,160.698,32.00,040815,,,A*5B
$GPGGA,135707.00,4526.72772,N,00502.01960,E,1,6,,424.4,M,,M,,*60
$GPRMC,135708.00,A,4526.76522,N,00502.05332,E,160.445,32.00,040815,,,A*5C
$GPGGA,135708.00,4526.76522,N,00502.05332,E,1,6,,424.2,M,,M,,*63
$GPRMC,135709.00,A,4526.80284,N,00502.08812,E,160.659,32.00,040815,,,A*54
$GPGGA,135709.00,4526.80284,N,00502.08812,E,1,6,,422.2,M,,M,,*62
$GPRMC,135736.00,A,4527.87882,N,00502.67354,E,158.268,6.00,040815,,,A*68
$GPGGA,135736.00,4527.87882,N,00502.67354,E,1,6,,374.9,M,,M,,*6B
$GPRMC,135737.00,A,4527.92688,N,00502.68110,E,158.015,5.00,040815,,,A*6F
$GPGGA,135737.00,4527.92688,N,00502.68110,E,1,6,,369.0,M,,M,,*62
$GPRMC,135738.00,A,4527.97380,N,00502.68734,E,158.015,4.00,040815,,,A*69
$GPGGA,135738.00,4527.97380,N,00502.68734,E,1,6,,363.1,M,,M,,*6E

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0" creator="GPSBabel - http://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/0">
  <time>2015-08-09T01:17:30.138Z</time>
  <bounds minlat="45.445462000" minlon="<a href="tel:5.033660000" value="+15033660000">5.033660000" maxlat="45.465448000" maxlon="5.044685000"/>
  <trk>
    <trkseg>
      <trkpt lat="45.445462000" lon="5.033660000">
        <time>2015-08-04T13:57:07Z</time>
        <course>32.000000</course>
        <speed>82.670197</speed>
      </trkpt>
      <trkpt lat="45.445462000" lon="5.033660000">
        <ele>424.400000</ele>
        <time>2015-08-04T13:57:08Z</time>
        <course>32.000000</course>
        <speed>82.540039</speed>
        <geoidheight>0.0</geoidheight>
        <fix>3d</fix>
        <sat>6</sat>
      </trkpt>
      <trkpt lat="45.446087000" lon="5.034222000">
        <ele>424.200000</ele>
        <time>2015-08-04T13:57:09Z</time>
        <course>32.000000</course>
        <speed>82.650131</speed>
        <geoidheight>0.0</geoidheight>
        <fix>3d</fix>
        <sat>6</sat>
      </trkpt>
      <trkpt lat="45.446714000" lon="5.034802000">
        <ele>422.200000</ele>
        <time>2015-08-04T13:57:36Z</time>
        <course>6.000000</course>
        <speed>81.420090</speed>
        <geoidheight>0.0</geoidheight>
        <fix>3d</fix>
        <sat>6</sat>
      </trkpt>
      <trkpt lat="45.464647000" lon="5.044559000">
        <ele>374.900000</ele>
        <time>2015-08-04T13:57:37Z</time>
        <course>5.000000</course>
        <speed>81.289940</speed>
        <geoidheight>0.0</geoidheight>
        <fix>3d</fix>
        <sat>6</sat>
      </trkpt>
      <trkpt lat="45.465448000" lon="5.044685000">
        <ele>369.000000</ele>
        <time>2015-08-04T13:57:38Z</time>
        <course>4.000000</course>
        <speed>81.289940</speed>
        <geoidheight>0.0</geoidheight>
        <fix>3d</fix>
        <sat>6</sat>
      </trkpt>
    </trkseg>
  </trk>
</gpx>


------------------------------------------------------------------------------
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc


------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc