Bug in KML time stamp reading

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

Bug in KML time stamp reading

Rickey W
Hi

Thank you guys for your great work on gpsbabel. Really nice program. 

There seems to be a bug with reading KML timezone. After reading the KML <when> XML dateTime element, gpsbabel should calculate the GMT time for formats such as GPX. However, the program seems to only compute the time but not the date. The date is only bumped up when the original dateTime element changes. 

For example, <when>2014-08-26T23:57:24.042-07:00</when> in KML becomes <time>2014-08-26T06:57:24.042Z</time>in GPX, when it in fact should have been <time>2014-08-27T06:57:24.042Z</time>

I've attached a few examples here. 

Thanks 

Rickey

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

_______________________________________________
Gpsbabel-code mailing list  http://www.gpsbabel.org
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code

ascii output.txt (1K) Download Attachment
bad_gpsbabel_output.gpx (2K) Download Attachment
good_kml2gpx_output.gpx (8K) Download Attachment
input.kml (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bug in KML time stamp reading

Robert Lipe-4
In gpx.cc (yes, that's a bad place for it...) in xml_parse_time(), near the end you'll find a time = time.addSecs.  Try instead replacing that with

// time = time.addSecs(XXX)
dt = QDateTime(as before...)
dt = dt.addSecs(that formula above from XXX)

That stands a much better chance of getting times that span a date right.

On Fri, Jun 5, 2015 at 7:14 PM, Rickey W <[hidden email]> wrote:
Hi

Thank you guys for your great work on gpsbabel. Really nice program. 

There seems to be a bug with reading KML timezone. After reading the KML <when> XML dateTime element, gpsbabel should calculate the GMT time for formats such as GPX. However, the program seems to only compute the time but not the date. The date is only bumped up when the original dateTime element changes. 

For example, <when>2014-08-26T23:57:24.042-07:00</when> in KML becomes <time>2014-08-26T06:57:24.042Z</time>in GPX, when it in fact should have been <time>2014-08-27T06:57:24.042Z</time>

I've attached a few examples here. 

Thanks 

Rickey

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

_______________________________________________
Gpsbabel-code mailing list  http://www.gpsbabel.org
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code



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

_______________________________________________
Gpsbabel-code mailing list  http://www.gpsbabel.org
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code
Loading...