1KML2GMT(1) GMT KML2GMT(1)
2
3
4
6 kml2gmt - Extract GMT table data from Google Earth KML files
7
9 kml2gmt [ kmlfiles ] [ -Fs|l|p ] [ -V[level] ] [ -Z ] [ -bobinary ]
10 [ -donodata ] [ -:[i|o] ]
11
12 Note: No space is allowed between the option flag and the associated
13 arguments.
14
16 kml2gmt reads a Google Earth KML file and outputs a GMT table file.
17 Only KML files that contain points, lines, or polygons can be pro‐
18 cessed. This is a bare-bones operation that aims to extract coordi‐
19 nates and possibly the name and description tags of each feature. The
20 main use intended is to capture coordinates modified in Google Earth
21 and then reinsert the modified data into the original GMT data file.
22 For a more complete reformatting, consider using ogr2ogr -f "GMT" some‐
23 file.gmt somefile.kml.
24
26 None.
27
29 kmlfiles
30 Name of one or more KML files to work on. If not are given, then
31 standard input is read.
32
33 -Fs|l|p
34 Specify a particular feature type to output. Choose from points
35 (s), line, or polygon. By default we output all geometries.
36
37 -Z Output the altitude coordinates as GMT z coordinates [Default
38 will output just longitude and latitude].
39
40 -V[level] (more ...)
41 Select verbosity level [c].
42
43 -bo[ncols][type] (more ...)
44 Select native binary output.
45
46 -donodata (more ...)
47 Replace output columns that equal NaN with nodata.
48
49 -:[i|o] (more ...)
50 Swap 1st and 2nd column on input and/or output.
51
52 -^ or just -
53 Print a short message about the syntax of the command, then
54 exits (NOTE: on Windows just use -).
55
56 -+ or just +
57 Print an extensive usage (help) message, including the explana‐
58 tion of any module-specific option (but not the GMT common
59 options), then exits.
60
61 -? or no arguments
62 Print a complete usage (help) message, including the explanation
63 of all options, then exits.
64
66 To extract the lon,lat values from the KML file google.kml, try
67 gmt kml2gmt google.kml -V > google.txt
68
69 To separate the point and polygon geometries from the KML file
70 google.kml, try
71 gmt kml2gmt google.kml -Fp -V > polygons.txt
72
73 gmt kml2gmt google.kml -Fs -V > points.txt
74
76 gmt, gmt.conf, img2google, psconvert, gmt2kml
77
79 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
80
81
82
83
845.4.5 Feb 24, 2019 KML2GMT(1)