Re: gmt2kml -L with a sting?

Paul Wessel <[email protected]>
Newsgroups gmane.comp.gis.gmt.user
Message-ID <[email protected]>
JJ-

I dont think there are an column numbers in -L.  You just have to arrange your input to be
lon lat DRFT044RR lat

and then do
gmt2kml file.gmt -Lname,lat

i.e., if you want 5 extra columns then -L will specify the 5 names and your data columns will have to have those 5 extra columns in that order.

-p

On Apr 13, 2014, at 10:37 AM, Becker, Joseph J. <[email protected]> wrote:

> Basically I love gmt2kml. 
> 
> The output below is probably easier to understand than my question…
> 
> ===
> 
> While
> 
> 	gmt2kml file.gmt -L8:name,3:lat …
> 
> does exactly what I want if there is numeric data in the “gmt” file columns, e.g. lat, lon, time,
> 
> 	if the column has string, e.g. “DRFT04RR”, then the KML is output with NaN
> 
> <Data name = "name">
> 	<value>NaN</value>
> </Data>
> 
> 
> is there a way to get a column with a string into the KML ?
> 
> I have control of the file input to gmt2kml so I can add quotes, backslashes, or whatever to the string
> 
> 
> Thanks,
> 
> JJ
> 
> ================
> 
> $ head -1 test.txt 
> 
> -109.765540    25.569340      -3180      -1967      -1213       9999         54169      89654 “DRFT04RR”
> 
> 
> $ head -1 test.txt | gmt2kml -L8:name
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <kml xmlns="http://www.opengis.net/kml/2.2">
> <Document>
> 	<name>GMT Data Document</name>
> 	<Style id="GMT-36236-0">
> 		<IconStyle>
> 			<scale>1</scale>
> 			<color>ff80c0ff</color>
> 			<Icon>
> 				<href>http://maps.google.com/mapfiles/kml/pal4/icon57.png</href>
> 			</Icon>
> 		</IconStyle>
> 		<LineStyle>
> 			<color>ff000000</color>
> 			<width>1</width>
> 		</LineStyle>
> 		<PolyStyle>
> 			<color>bf80c0ff</color>
> 			<fill>1</fill>
> 			<outline>1</outline>
> 		</PolyStyle>
> 		<LabelStyle>
> 			<scale>1</scale>
> 			<color>ffffffff</color>
> 		</LabelStyle>
> 	</Style>
> 	<Folder>
> 		<name>Point Set 0</name>
> 		<Placemark>
> 			<name>Point 0</name>
> 			<ExtendedData>
> 				<Data name = "name">
> 					<value>NaN</value>
> 				</Data>
> 			</ExtendedData>
> 			<styleUrl>#GMT-36236-0</styleUrl>
> 			<Point>
> 					<coordinates>-109.76554,25.56934,0</coordinates>
> 			</Point>
> 		</Placemark>
> 	</Folder>
> </Document>
> </kml>
> sherwood:Desktop jbecker$ 
> 
> 
> 
> 
> To unsubscribe, send the message "signoff gmt-help" to [email protected]

To unsubscribe, send the message "signoff gmt-help" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.