kml2gmt — GMT 5.1.1 documentation

### Navigation

- index
- next
- previous
- Project Home »
- GMT 5.1.1 documentation »
- K »
- Search:

# kml2gmt

kml2gmt - Extract GMT table data from Google Earth KML files

## Synopsis

kml2gmt [ kmlfiles ] [ -V[level] ] [ -Z ] [ -bo[ncols][type][w][+L|+B] ] [ -:[i|o] ]

Note: No space is allowed between the option flag and the associated arguments.

## Description

kml2gmt reads a Google Earth KML file and outputs a GMT table file. Only KML files that contain points, lines, or polygons can be processed. This is a bare-bones operation that aims to extract coordinates and possibly the name and description tags of each feature. The main use intended is to capture coordinates modified in Google Earth and then reinsert the modified data into the original GMT data file. For a more complete reformatting, consider using ogr2ogr -f “GMT” somefile.gmt somefile.kml.

## Required Arguments

None.

## Optional Arguments

kmlfiles
  Name of one or more KML files to work on. If not are given, then standard input is read.
-Z
  Output the altitude coordinates as GMT z coordinates [Default will output just longitude and latitude].

-V[level] (more ...)
  Select verbosity level [c].

-bo[ncols][type] (more ...)
  Select binary output.

-:[i|o] (more ...)
  Swap 1st and 2nd column on input and/or output.

-^
  Print a short message about the syntax of the command, then exits (NOTE: on Windows use just -).
+
  Print an extensive usage (help) message, including the explanation of any module-specific option (but not the GMT common options), then exits.
-?
  Print a complete usage (help) message, including the explanation of options, then exits.
--version
  Print GMT version and exit.
--show-datadir
  Print full path to GMT share directory and exit.

## Examples

To extract the lon,lat values from the KML file google.kml, try

> gmt kml2gmt google.kml -V > google.txt

## See Also

gmt, gmt.conf, img2google, ps2raster, gmt2kml

### Navigation

- index
- next
- previous
- Project Home »
- GMT 5.1.1 documentation »
- K »
- Search: