Bug #625

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

Added by Eduardo about 3 years ago. Updated almost 3 years ago.

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


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


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 about 3 years ago

Address issue #625

Revision 13546
Added by Paul almost 3 years ago

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


#1 Updated by Paul about 3 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 about 3 years ago

example.kml says:

                <name>Point Features</name>
                <description>Point Features</description>

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 almost 3 years ago

OK, try now in r13546.

#4 Updated by Eduardo almost 3 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">

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");


#5 Updated by Paul almost 3 years ago

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

#6 Updated by Eduardo almost 3 years ago

working well, please close.

$ kml2gmt basic.kml 
-1.5    55

#7 Updated by Paul almost 3 years ago

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

Closing this puppy down.

Also available in: Atom PDF