jorgesca / garmintools

Automatically exported from code.google.com/p/garmintools
GNU General Public License v2.0
0 stars 1 forks source link

Incorrect precision in garmin_gpx #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a GPX file through garmin_gpx
2. Generate same (partial) track by using gpsbabel directly from device.

What is the expected output? What do you see instead?
Ca. identical precision on track points.

Please provide any additional information below.
From skimming the source code, it seems gpsbabel uses doubles for lat/long 
while garmin_gpx uses float's...

Original issue reported on code.google.com by msieb...@gmail.com on 22 Aug 2009 at 9:05

GoogleCodeExporter commented 9 years ago
Directly from device using gpsbabel:

  ...
  <trkpt lat="55.673035383" lon="12.572800443">
    <ele>1.579346</ele>
    <time>2009-08-21T09:45:12Z</time>
  </trkpt>
  ...

From garmin_gpx:

  ...
  <rtept lat="55.673035000" lon="12.572801000">
    <ele>1.579346</ele>
    <time>2009-08-21T09:45:12Z</time>
    <name>RPT001</name>
  </rtept>
  ...

(Also, gpsbabel generates tracks, while garmin_gpx generates routes...)

Original comment by msieb...@gmail.com on 22 Aug 2009 at 9:09

GoogleCodeExporter commented 9 years ago
I've written a small patch that perhaps fixes this - I haven't diffed the data
against a gpsbabel-generated GPX file, but it seemed that changing "%f" to 
"%.9f"
achieves this.

(Also, I haven't done the math on how much this really adds in the real world - 
does
the last few decimal places add meters in precision, centimeters, or?)

Original comment by msieb...@gmail.com on 22 Aug 2009 at 9:50

Attachments: