I have the following simple file, which originally was converted from a shapefile with ogr2ogr and alot larger and more complex. I tried removing field after field to expose the offending data field, but even this cause problems:
$ gmt psxy plume.gmt -JX10c -RNO > /dev/null
psxy [WARNING]: Bad OGR/GMT: @T record has more items than declared by @N - skipping
psxy [WARNING]: Bad OGR/GMT: @T record has more items than declared by @N - skipping
psxy [WARNING]: Bad OGR/GMT: @T record has more items than declared by @N - skipping
psxy [WARNING]: Bad OGR/GMT: @D record has more items than declared by @N
psxy [WARNING]: Bad OGR/GMT: @D record has more items than declared by @N
psxy [WARNING]: Bad OGR/GMT: @D record has more items than declared by @N
Should not this file run just fine? 4 attributes (@N), 4 definitions (@T) and 4 data fields (@D).
Despite the script complaining, the map is generated fine. At first I thought that wrapping the attribute names in quotes might help but it does not make a difference.
I then tested getting rid of the spaces in your attribute names - e.g. Name ID to NameID and with that I don’t get error message anymore. So this seems to be that the OGR2GR driver doesn’t like spaces in the attribute names.
I have made this part more robust in GMT. I was/am under the impressions that string argument with spaces shall be inside double-quotes, but if I understand you correctly the ogr2ogr output did not have these quotes (?). The fix has been merged into master.
As far as I know, the GDAL team are maintaining all the drivers; the GMT/OGR was written by Frank Warnerdam.
Tested; gmt does not complain any longer - looks good, Paul!
I tested with two versions of ogr2ogr, GDAL 2.4.0, released 2018/12/14 and GDAL 3.1.4, released 2020/10/20. None of them put quotation marks in @N, even if the string argument contain spaces. Which caused problems, ref. Christians post. It will put double-quotes in @D if necessary.
Other improvements of the OGR_GMT driver between these two versions, for those interested:
Fix trailing space in @Jp: @Jp"+proj=longlat +datum=WGS84 +no_defs " → @Jp"+proj=longlat +datum=WGS84 +no_defs"
Added info in @Jw: ,AXIS[\"Latitude\",NORTH],AXIS[\"Longitude\",EAST],
Pointless decimals are removed: 152.5 -60.0 → 152.5 -60
Attached is the diff. Extension is zip but it’s a plain text file.