Bug #625

kml2gmt re-uses previous <name>...</name> value

Added by Eduardo over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:2014-09-20
Priority:NormalDue date:
Assignee:Paul% Done:

100%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:Linux

Description

If there is a missing <name>...</name> KML tag kml2gmt re-uses previous name tag value or dreams up what he wants.

I'll prefer a -L"" or no -L at all.

Also in the second example, the coordinates are replaced with 0,0.

Examples files attached. I've tested the KML examples with Google Maps and ogr2ogr without complains.

example.kml (3.63 KB) Eduardo, 2014-09-20 13:33

basic.kml (214 Bytes) Eduardo, 2014-09-20 14:31

Associated revisions

Revision 13543
Added by Paul over 2 years ago

Address issue #625

Revision 13546
Added by Paul over 2 years ago

Fix getting the right name and description from Placemark for issue #625

History

#1 Updated by Paul over 2 years ago

  • Status changed from New to Resolved
  • Assignee set to Paul

I now reset the internal name and description to NULL after each output coordinate so now there will be no -L or -D is none is set via <name> and <description>.
Also, there was an assumption that single points would be listed on one line as <coordinates>x,y,z</coordinates> and not as in your basic.kml example. We now consider both possibilities. In r13543, let me know if OK for you.

#2 Updated by Eduardo over 2 years ago

example.kml says:

        <Folder>
                <name>Point Features</name>
                <description>Point Features</description>
                <Placemark>
                        <description>CAPA</description>
                        <styleUrl>#point11</styleUrl>
                        <Point>
                                <coordinates>-57.9407034317,-34.943600809,0</coordinates>
                        </Point>
                </Placemark>

the first <Placemark> has not a <name> but kml2gmt is using the value which appears after <Folder>, the other <Placemark> instances are fine.

In basic.kml, the coordinates are fine, but why appears Next Point in the segment separator?

#3 Updated by Paul over 2 years ago

OK, try now in r13546.

#4 Updated by Eduardo over 2 years ago

The option -Fs|l|p works great!

With this KML file

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
 <Placemark>
   <Point>
    <coordinates>
     -1.5,55
    </coordinates>
  </Point>
 </Placemark>
</Document>
</kml>

I get
> Next Point
-1.5    55

That is the program intent as I can see in
if (!GMT->current.io.segment_header[0]) sprintf (GMT->current.io.segment_header, "Next Point");

yes?

#5 Updated by Paul over 2 years ago

I've now removed that unnecessary text. A blank segment header is fine. In r13551.

#6 Updated by Eduardo over 2 years ago

working well, please close.

$ kml2gmt basic.kml 
>
-1.5    55

#7 Updated by Paul over 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100

Closing this puppy down.

Also available in: Atom PDF