GMT ShapeFile Plotting Issues

Hi,

I’m attempting to plot a shapefile containing lakes from https://www.bcn.cl/siit/mapas_vectoriales/index_html.
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
proj=-JM15
bounds=-R-72.20/-71.75/-39.55/-39.25

#Files
lakes=/Users/FelixBoschetty/Desktop/ChileShapeFiles/Masas_Lacustres/masas_lacustres.shp

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!

Thanks,

Felix


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.