-
Notifications
You must be signed in to change notification settings - Fork 408
Closed
Labels
feature requestRequest a new featureRequest a new feature
Description
Description of the desired feature
Since last century, the grid header strings title, history and remake (as well as units) have been defined as
char x_units[GMT_GRID_UNIT_LEN80]; /* units in x-direction */
char y_units[GMT_GRID_UNIT_LEN80]; /* units in y-direction */
char z_units[GMT_GRID_UNIT_LEN80]; /* grid value units */
char title[GMT_GRID_TITLE_LEN80]; /* name of data set */
char command[GMT_GRID_COMMAND_LEN320]; /* name of generating command */
char remark[GMT_GRID_REMARK_LEN160]; /* comments re this data set */
Hence, any GMT native binary grids are limited to those lengths. However, there is no good reasons to limit these strings for the more typical format such as netCDF. I am currently trying to set a remark to contain a citation and running into the 160 limit, which is silly. Also, many netCDF files have a series of concatenated command histories and even 320 becomes too small.
I think this is a backwards compatible change:
- Replace the above fixed length char arrays with char pointers.
- Let
GMT->session.readinfo[]be the places where we allocate these strings based on what we find in the file - When writing native grids and any other format with a limit on string length, ensure we max write the length as indicated above.
- When a grid header is freed, we free these strings as well.
Any unforeseen consequences with this, @GenericMappingTools/gmt-team?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestRequest a new featureRequest a new feature