GMT ShapeFile Plotting Issues


I’m attempting to plot a shapefile containing lakes from
It’s the masa de agua file.
The shapefile opens fine in QGIS, but it has many many features.
I’ve tried saving a smaller region on the shapefile (masas_lacustres_SMALL.shp also attached) but I get the same error.

GMT script:

#map parameters


gmt begin 2015_Sampling
  gmt basemap $proj $bounds -Baf
  # Plot lakes
  gmt plot $lakes $bounds $proj -Glightblue
gmt end show

The error I get is:
[ERROR]: Bad OGR/GMT: @n not allowed before FEATURE_DATA

I get a blank basemap with no lakes!



GMT version 6.4.0
MacOS Monterey 12.6.3

I suspect that it might be to do with the projection of either my basemap or the .shp file. I have tried converting it to a .gmt file using ogr2ogr and it has no complaints.

ogr2ogr -t_srs EPSG:4326 Lakes.gmt Lakes.shp

Then when I run my GMT script I don’t get an error, but I still can’t see anything on my basemap.

Not sure what changed, but after redownloading and trying the same ogr2ogr line on the file it seems to work fine. Perhaps I managed to save the .shp file when opening it in QGIS to check it worked.