# GMT — GMT ASCII Vectors (.gmt)

> GMT (GMT ASCII Vectors (.gmt)): Plain-text vector format of the Generic Mapping Tools, storing multi-segment points, lines and polygons. Specs, software and free sample files; convert GMT to 39 formats online.

- Page: https://beta.mygeodata.cloud/formats/gmt



## What is a GMT file?

GMT ASCII Vectors is the plain-text vector format used by the Generic Mapping Tools (GMT), an open-source collection of command-line programs for processing geographic data and producing maps, originally created by Paul Wessel and Walter H. F. Smith. In its basic form a file lists coordinate pairs line by line, with lines starting with ">" separating individual segments such as lines or polygon rings.

An extended convention adds comment headers beginning with "# @": the first line identifies the version and geometry type, while further keys record the region, projection, field names, field types and per-segment attribute values. A file can therefore hold attributed points, lines or polygons, but only one geometry type and one layer. The coordinate reference system may be stored as an EPSG code, PROJ string or WKT, and data is often geographic WGS 84. The format is common in geophysics, oceanography and academic cartography.

GMT ASCII Vectors files are usually exchanged by researchers in geophysics, oceanography and academic mapping who work with the Generic Mapping Tools. Because the file is plain text, it is easy to inspect and edit, but a file holds only one geometry type and one layer. Check the coordinate order, the segment separators and whether the "# @" header carries the CRS and attribute fields before converting.

### Technical details

| | |
|---|---|
| Full name | GMT ASCII Vectors (.gmt) |
| Data type | Vector · GIS vector |
| File extension | .gmt |
| Files | Single file |
| Media type | text/plain |
| Geometry types | Point, LineString, Polygon |
| Multiple layers | No |
| Mixed geometry in a layer | No |
| Attribute names | — |
| Coordinate system | Any (EPSG, ESRI, custom) |
| Converter support | Read & write |
| Typical software | Generic Mapping Tools, PyGMT, GDAL/OGR, QGIS |
| Specification | https://www.generic-mapping-tools.org/ |

### Specifications & references

- https://www.generic-mapping-tools.org/
- https://gdal.org/en/stable/drivers/vector/gmt.html

### Sample GMT files — free download

- [Roads and paths (lines)](https://beta.mygeodata.cloud/static/landing/samples/v1/ogr_gmt/st-helena-roads.gmt) — 110 named roads, streets, tracks and paths (OSM segments merged by name) with class, surface, speed limit and length. GMT vector (OGR_GMT) text format. (113.2 kB, EPSG:4326)
- [Land cover (polygons)](https://beta.mygeodata.cloud/static/landing/samples/v1/ogr_gmt/st-helena-landcover.gmt) — 190 land-cover polygons (forest, scrub, farmland, residential, water, …) from OpenStreetMap with area in hectares. GMT vector (OGR_GMT) text format. (130.5 kB, EPSG:4326)

### Convert GMT to other formats

- [GMT to DXF](https://beta.mygeodata.cloud/converter/gmt-to-dxf)
- [GMT to SHP](https://beta.mygeodata.cloud/converter/gmt-to-shp)
- [GMT to CSV](https://beta.mygeodata.cloud/converter/gmt-to-csv)
- [GMT to KML](https://beta.mygeodata.cloud/converter/gmt-to-kml)
- [GMT to KMZ](https://beta.mygeodata.cloud/converter/gmt-to-kmz)
- [GMT to GeoJSON](https://beta.mygeodata.cloud/converter/gmt-to-geojson)
- [GMT to XLSX](https://beta.mygeodata.cloud/converter/gmt-to-xlsx)
- [GMT to GeoPDF](https://beta.mygeodata.cloud/converter/gmt-to-geopdf)
- [GMT to GPKG](https://beta.mygeodata.cloud/converter/gmt-to-gpkg)
- [GMT to GPX](https://beta.mygeodata.cloud/converter/gmt-to-gpx)
- [GMT to TopoJSON](https://beta.mygeodata.cloud/converter/gmt-to-topojson)
- [GMT to SQLite](https://beta.mygeodata.cloud/converter/gmt-to-sqlite)
- [GMT to MapInfo](https://beta.mygeodata.cloud/converter/gmt-to-mapinfo)
- [GMT to DGN](https://beta.mygeodata.cloud/converter/gmt-to-dgn)
- [GMT to netCDF](https://beta.mygeodata.cloud/converter/gmt-to-netcdf)
- [GMT to WKT](https://beta.mygeodata.cloud/converter/gmt-to-wkt)
- [GMT to GML](https://beta.mygeodata.cloud/converter/gmt-to-gml)
- [GMT to FGB](https://beta.mygeodata.cloud/converter/gmt-to-fgb)

## Frequently asked questions

### Why are my attributes or projection missing after opening a GMT file?

Attributes and CRS are only stored if the file uses the extended "# @" header convention. A basic file contains just coordinates and ">" segment separators, so no field names or projection can be read from it.

### Can a GMT file contain mixed geometry types or several layers?

No. A file holds one geometry type (points, lines or polygons) and a single layer. To keep mixed data, split it into separate GMT files, one for each geometry type.

### How does GMT ASCII differ from a plain XYZ or CSV coordinate file?

A plain XYZ or CSV file is just a table of values with no notion of lines or polygons. GMT ASCII uses ">" lines to split segments and can add a header with region, projection and attribute information.

### What is a GMT file?

GMT ASCII Vectors is the plain-text vector format used by the Generic Mapping Tools (GMT), an open-source collection of command-line programs for processing geographic data and producing maps, originally created by Paul Wessel and Walter H. F. Smith. In its basic form a file lists coordinate pairs line by line, with lines starting with ">" separating individual segments such as lines or polygon rings.

An extended convention adds comment headers beginning with "# @": the first line identifies the version and geometry type, while further keys record the region, projection, field names, field types and per-segment attribute values. A file can therefore hold attributed points, lines or polygons, but only one geometry type and one layer. The coordinate reference system may be stored as an EPSG code, PROJ string or WKT, and data is often geographic WGS 84. The format is common in geophysics, oceanography and academic cartography.

### How do I open a GMT file?

GMT files can be opened in Generic Mapping Tools, PyGMT, GDAL/OGR and QGIS. Without any software you can preview and convert them online in MyGeodata Cloud.

### What can I convert GMT to?

Popular conversions are DXF, SHP, CSV, KML, KMZ and GeoJSON. In total the Converter writes GMT data to 39 formats.

### How do I create a GMT file?

Convert existing data to GMT — for example from CSV, DWG, DXF, GeoJSON and GeoPDF. Upload the file, choose GMT as output and download the result.

