esolliday / libkml

Automatically exported from code.google.com/p/libkml
Other
0 stars 0 forks source link

Malformed <coordinates> parses but gives really bad data. #140

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load in the LineString
<Placemark>
      <name>Continental Convergent Boundary</name>
        <LineString>         
<coordinates>-55.80970002,-60.7000999276855,0,-55.0666008,-60.7630997476855,0,-5
4.30899808,-60.9776001676856,0,-54.30070116,-61.5102005476855,0</coordinates>
        </LineString>
</Placemark>

2. Notices the coordinate string is incorrect because there is a comma
inbetween each LLA. lon, lat, alt, lon, lat, alt, instead of lon, lat, alt
lon, lat, alt

3. libKml gives me back 6 coordinates (-55.80970002,-60.7000999276855,0)
which is correct then I get (0,-55.0666008,-60.7630997476855), which is
definitely not. I get 6 sets of LLAs, when there is only 4. 

What is the expected output? What do you see instead?
I render this and obviously it is no where near correct. It however loads
in Google Earth and so there are a bunch of existing Kmls from public
government sites that have this.

What version of the product are you using? On what operating system?

Version 1.0 on Windows XP.

Did you run the unit test suite that comes with the project? Did all tests
pass?

Yes

Please provide any additional information below.

Original issue reported on code.google.com by tomfil...@gmail.com on 15 Mar 2010 at 3:56

GoogleCodeExporter commented 8 years ago
Upgrade your your world to the latest and greatest. This one was fixed by r729: 
http://code.google.com/p/libkml/source/detail?spec=svn805&r=729

mashbridge@petrichor bactrian$ cat /tmp/x.kml
<Placemark>
     <name>Continental Convergent Boundary</name>
       <LineString>
<coordinates>-55.80970002,-60.7000999276855,0,-55.0666008,-
60.7630997476855,0,-54.30899808,-60.9776001676856,0,-54.30070116,-
61.5102005476855,0</coordinates>
       </LineString>
</Placemark>

mashbridge@petrichor bactrian$ ./build/examples/helloworld/prettykml /tmp/x.kml
<?xml version="1.0" encoding="utf-8"?>
<Placemark xmlns="http://www.opengis.net/kml/2.2">
  <name>Continental Convergent Boundary</name>
  <LineString>
    <coordinates>
      -55.80970002,-60.7000999276855,0
      -55.0666008,-60.7630997476855,0
      -54.30899808,-60.9776001676856,0
      -54.30070116,-61.5102005476855,0
    </coordinates>
  </LineString>
</Placemark>

Original comment by kml.mash...@gmail.com on 15 Mar 2010 at 5:15