g_ascii_formatd() with .9 precision should give the same precision as
GPSBabel gives. However, I am not aware of a precision in the gpx
specification. I think they do not specify one. So in theory, with
this solution, you could have a gpx file lat=0.0123456789. then
vikings reads it into a double, which is able to hold this
information, but later you write to the gpx file: lat=0.012345678 (or
maybe lat=0.012345679).
That is, you lost precision. I'm not sure if this is an ideal solution.

Then again, I think it is not a real issue, it could stay the way it
is, or be changed to %.9f. It is accurate enough.

I found a relevant post:
     "On the usefulness of g_ascii_dtostr"
      
http://lists-archives.org/gtk-devel/05233-on-the-usefulness-of-g_ascii_dtostr.html

The most robust solution might be to follow the path suggested their:
to produce the shortest string needed to represent all the bits of
information in the double float point number for a 64bit floating
point.
I don't think this is worth the trouble. I believe that the loss of
the speed,dop etc. is a far more serious issue.

Tal


On Tue, Apr 28, 2009 at 6:41 PM, Guilhem Bonnefille
<guilhem.bonnefi...@gmail.com> wrote:
> Great thank for this analyse. What about using g_ascii_formatd with .9
> precision instead of g_ascii_dtostr?
>
> --
> Guilhem BONNEFILLE
> -=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com
> -=- mailto:guilhem.bonnefi...@gmail.com
> -=- http://nathguil.free.fr/
>

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to