# Using shapefiles in GMT

**URL:** <https://forum.generic-mapping-tools.org/t/using-shapefiles-in-gmt/6283>\
**Category:** Q&A\
**Created:** [November 11, 2025, 9:04am UTC](https://forum.generic-mapping-tools.org/t/using-shapefiles-in-gmt/6283 "2025-11-11T09:04:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![usifohsaturday](https://avatars.discourse-cdn.com/v4/letter/u/d2c977/32.png) [@usifohsaturday](https://forum.generic-mapping-tools.org/u/usifohsaturday)\
**Post date:** [November 11, 2025, 9:04am UTC](https://forum.generic-mapping-tools.org/t/using-shapefiles-in-gmt/6283/1 "2025-11-11T09:04:47Z")

</div>

Good morning everyone.

I’m trying to plot a map of East Africa showing the fault lines using shapefiles. I have a file named _ **gem\_active\_faults.shp** _, but when I ran my GMT code, I received the following output (shown below).

Could someone please help me figure out what’s causing this issue?

I’m currently using **GMT version 6.1.0**.

→ `PCIDSK' -> `netCDF’  
 → `PDS4' -> `VICAR’  
 → `PDF' -> `MBTiles’  
 → `BAG' -> `EEDA’  
 → `OGCAPI' -> `ESRI Shapefile’  
 → `MapInfo File' -> `UK .NTF’  
 → `OGR_SDTS' -> `S57’  
 → `DGN' -> `OGR\_VRT’  
 → `REC' -> `Memory’  
 → `CSV' -> `GML’  
 → `GPX' -> `KML’  
 → `GeoJSON' -> `GeoJSONSeq’  
 → `ESRIJSON' -> `TopoJSON’  
 → `OGR_GMT' -> `GPKG’  
 → `SQLite' -> `WAsP’  
 → `OpenFileGDB' -> `DXF’  
 → `CAD' -> `FlatGeobuf’  
 → `Geoconcept' -> `GeoRSS’  
 → `GPSTrackMaker' -> `VFK’  
 → `PGDUMP' -> `OSM’  
 → `GPSBabel' -> `OGR\_PDS’  
 → `WFS' -> `OAPIF’  
 → `EDIGEO' -> `SVG’  
 → `CouchDB' -> `Cloudant’  
 → `Idrisi' -> `ARCGEN’  
 → `Elasticsearch' -> `Carto’  
 → `AmigoCloud' -> `SXF’  
 → `Selafin' -> `JML’  
 → `PLSCENES' -> `CSW’  
 → `VDV' -> `MVT’  
 → `NGW' -> `MapML’  
 → `TIGER' -> `AVCBin’  
 → `AVCE00' -> `HTTP’  
plot [ERROR]: System call [ogr2ogr -mapFieldType Integer64=Integer -skipfailures -f “OGR\_GMT” “/tmp/gmt\_ogr\_3727.gmt” “gem\_active\_faults.shp”] FAILED with error 256.  
plot [ERROR]: Cannot open file gem\_active\_faults.shp  
parker.sh: line 53: EOF: command not found  
gmt [ERROR]: Not available in classic mode

The code  
gmt begin east\_africa\_faults\_map pdf

gmt set MAP\_FRAME\_TYPE plain

gmt set FONT\_LABEL 15p

gmt makecpt -Cjet -T-4.0/4.0

gmt basemap -R28/45/-12/15 -JM15c -Baf -BWSen+t"East Africa Faults"

ogr2ogr -f “GMT” faults.gmt gem\_active\_faults.shp

gmt plot gem\_active\_faults.shp -W0.8p,black

gmt coast -W0.25p -N1/0.5p,gray -A500 –Df

EOF

gmt end show

gmt end

looking forward for assistance

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [November 11, 2025, 4:57pm UTC](https://forum.generic-mapping-tools.org/t/using-shapefiles-in-gmt/6283/2 "2025-11-11T16:57:47Z")

</div>

What happens if you do:

```auto
ogr2ogr -F ‘OGR_GMT’ test.gmt gem_active_faults.shp

```

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [November 11, 2025, 6:42pm UTC](https://forum.generic-mapping-tools.org/t/using-shapefiles-in-gmt/6283/3 "2025-11-11T18:42:19Z")

</div>

This is not a GMT.jl question. Is it so difficult to respect the categories?

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [November 12, 2025, 11:02am UTC](https://forum.generic-mapping-tools.org/t/using-shapefiles-in-gmt/6283/4 "2025-11-12T11:02:56Z")

</div>

Hey @usifohsaturday,

I think you use the data available at [gem-global-active-faults/shapefile at master · cossatot/gem-global-active-faults · GitHub](https://github.com/cossatot/gem-global-active-faults/tree/master/shapefile). I just tried this, and the conversion seems to work for me.

Please keep in mind that a shapefile is not one single file, but there are several files with different extensions that are all important and should be placed in one folder. If I only have the file with the extension `*.shp` I get an error that has similarity with the one you posted.

Besides this

- You should use the converted file `faults.gmt` for plotting.
- The usage of `EOF` here is not clear to me.
- After using `gmt end show`, calling `gmt end` is not needed.
