KML LineString incorrectly read

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

KML LineString incorrectly read

François Bonzon
Hi,

GPSBabel 1.5.1 gives bad results when reading some KML LineStrings. Attached is a small sample file reproducing the problem.

Command line:
gpsbabel -t -i kml -f test.kml -o gpx -F test.gpx

Actual result (excerpt):

      <trkpt lat="47.373156290" lon="8.542703126"/>
      <trkpt lat="47.374251203" lon="8.542964157"/>
      <trkpt lat="47.373156290" lon="9.000000000"/>
      <trkpt lat="47.373156290" lon="765.000000000"/>
      <trkpt lat="47.373156290" lon="2871.000000000"/>
      <trkpt lat="47.373156290" lon="99466.000000000"/>
      <trkpt lat="47.373156290" lon="817874.000000000"/>
      <trkpt lat="47.373156290" lon="9757292.000000000"/>
      <trkpt lat="47.373156290" lon="82567767.000000000"/>
      <trkpt lat="47.373156290" lon="49219264.000000000"/>
      <trkpt lat="47.373156290" lon="170858332.000000000"/>
      <trkpt lat="47.373156290" lon="7629865799.000000000"/>
      <trkpt lat="47.373156290" lon="74659915814.000000000"/>
      <trkpt lat="47.373156290" lon="666485801238.000000000"/>

From 3rd point, latitude is constant and longitude goes crazy, which is not the case in the original KML file.

Best,
-F

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
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

test.gpx (1K) Download Attachment
test.kml (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: KML LineString incorrectly read

Robert Lipe-4
Thanx for the good test case.

Workingn theory: in kml.cc intrk_coord() the two sscanfs should end in %n and not \n and that iargs should be set to iargs.mid(consumed + 1)



On Tue, Nov 18, 2014 at 4:26 PM, François Bonzon <[hidden email]> wrote:
Hi,

GPSBabel 1.5.1 gives bad results when reading some KML LineStrings. Attached is a small sample file reproducing the problem.

Command line:
gpsbabel -t -i kml -f test.kml -o gpx -F test.gpx

Actual result (excerpt):

      <trkpt lat="47.373156290" lon="8.542703126"/>
      <trkpt lat="47.374251203" lon="8.542964157"/>
      <trkpt lat="47.373156290" lon="9.000000000"/>
      <trkpt lat="47.373156290" lon="765.000000000"/>
      <trkpt lat="47.373156290" lon="2871.000000000"/>
      <trkpt lat="47.373156290" lon="99466.000000000"/>
      <trkpt lat="47.373156290" lon="817874.000000000"/>
      <trkpt lat="47.373156290" lon="9757292.000000000"/>
      <trkpt lat="47.373156290" lon="82567767.000000000"/>
      <trkpt lat="47.373156290" lon="49219264.000000000"/>
      <trkpt lat="47.373156290" lon="170858332.000000000"/>
      <trkpt lat="47.373156290" lon="<a href="tel:7629865799" value="+17629865799" target="_blank">7629865799.000000000"/>
      <trkpt lat="47.373156290" lon="74659915814.000000000"/>
      <trkpt lat="47.373156290" lon="666485801238.000000000"/>

From 3rd point, latitude is constant and longitude goes crazy, which is not the case in the original KML file.

Best,
-F

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
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



------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
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: KML LineString incorrectly read

tsteven4-2
i have a fix. 
On 11/18/2014 5:03 PM, Robert Lipe wrote:
Thanx for the good test case.

Workingn theory: in kml.cc intrk_coord() the two sscanfs should end in %n and not \n and that iargs should be set to iargs.mid(consumed + 1)



On Tue, Nov 18, 2014 at 4:26 PM, François Bonzon <[hidden email]> wrote:
Hi,

GPSBabel 1.5.1 gives bad results when reading some KML LineStrings. Attached is a small sample file reproducing the problem.

Command line:
gpsbabel -t -i kml -f test.kml -o gpx -F test.gpx

Actual result (excerpt):

      <trkpt lat="47.373156290" lon="8.542703126"/>
      <trkpt lat="47.374251203" lon="8.542964157"/>
      <trkpt lat="47.373156290" lon="9.000000000"/>
      <trkpt lat="47.373156290" lon="765.000000000"/>
      <trkpt lat="47.373156290" lon="2871.000000000"/>
      <trkpt lat="47.373156290" lon="99466.000000000"/>
      <trkpt lat="47.373156290" lon="817874.000000000"/>
      <trkpt lat="47.373156290" lon="9757292.000000000"/>
      <trkpt lat="47.373156290" lon="82567767.000000000"/>
      <trkpt lat="47.373156290" lon="49219264.000000000"/>
      <trkpt lat="47.373156290" lon="170858332.000000000"/>
      <trkpt lat="47.373156290" lon="<a moz-do-not-send="true" href="tel:7629865799" value="+17629865799" target="_blank">7629865799.000000000"/>
      <trkpt lat="47.373156290" lon="74659915814.000000000"/>
      <trkpt lat="47.373156290" lon="666485801238.000000000"/>

From 3rd point, latitude is constant and longitude goes crazy, which is not the case in the original KML file.

Best,
-F

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
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




------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk


_______________________________________________
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


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
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: KML LineString incorrectly read

tsteven4-2
In reply to this post by François Bonzon
François,

Thanks.  This is fixed in https://code.google.com/p/gpsbabel/source/detail?r=4934.

Steve

On 11/18/2014 3:26 PM, François Bonzon wrote:
Hi,

GPSBabel 1.5.1 gives bad results when reading some KML LineStrings. Attached is a small sample file reproducing the problem.

Command line:
gpsbabel -t -i kml -f test.kml -o gpx -F test.gpx

Actual result (excerpt):

      <trkpt lat="47.373156290" lon="8.542703126"/>
      <trkpt lat="47.374251203" lon="8.542964157"/>
      <trkpt lat="47.373156290" lon="9.000000000"/>
      <trkpt lat="47.373156290" lon="765.000000000"/>
      <trkpt lat="47.373156290" lon="2871.000000000"/>
      <trkpt lat="47.373156290" lon="99466.000000000"/>
      <trkpt lat="47.373156290" lon="817874.000000000"/>
      <trkpt lat="47.373156290" lon="9757292.000000000"/>
      <trkpt lat="47.373156290" lon="82567767.000000000"/>
      <trkpt lat="47.373156290" lon="49219264.000000000"/>
      <trkpt lat="47.373156290" lon="170858332.000000000"/>
      <trkpt lat="47.373156290" lon="7629865799.000000000"/>
      <trkpt lat="47.373156290" lon="74659915814.000000000"/>
      <trkpt lat="47.373156290" lon="666485801238.000000000"/>

From 3rd point, latitude is constant and longitude goes crazy, which is not the case in the original KML file.

Best,
-F


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk


_______________________________________________
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


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
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