NetCDF is the default grid format produced by GMT, but is there any way to change this?
I would like GMT always to create GeoTIFFs; not NetCDF. I.e., it would be great if I don’t need to specify =gdal:GTiff every time.
Is this possible? I didn’t see any obvious options for this in gmt.conf.
How on earth did I miss that one. Thanks @mkononets, looks just right. Will test.
An important related parameter that does not seem to be configurable via gmt.conf is the default gridline grid registration (the -rp|g option). gdal that is used to produce geotiff files assumes grids are always is pixel-registered, which gmt apparently distinguish between gridline and pixel registration. This can result in lots of confusion (it used to confuse me a lot).
I see now that IO_GRIDFILE_FORMAT refers to grdconvert’s way of specifying the format. The identifier for gdal is `gd` for “Import/export through GDAL”. Not sure if this applies to the ‘new’ way of specifying output formats (I think grdconvert is ‘old’), e.g. grid.tif=gdal:GTIFF. I also suspect that IO_GRIDFILE_FORMAT only applies to grdconvert.
$ gmt set IO_GRIDFILE_FORMAT gd
$ gmt grdcut @earth_faa_01m -RSJ -Gsj_faa2.tif
grdconvert [ERROR]: Cannot find file (null)
grdblend [ERROR]: Unable to resample file (null).
grdcut [ERROR]: Cannot write with GDAL without knowing which driver to use.
$ gmt set IO_GRIDFILE_FORMAT gd:GTIFF
$ gmt grdcut @earth_faa_01m -RSJ -Gsj_faa2.tif
grdconvert [ERROR]: Cannot find file (null)
grdblend [ERROR]: Unable to resample file (null).
grdcut [ERROR]: Cannot write with GDAL without knowing which driver to use.
What does the use of the gridline grid reg actually offer over the pixel reg?
Quarter-size corner grid cell, half-size edge cells… I am surely missing something important.
Note: (at least) grdmath picks up IO_GRIDFILE_FORMAT in gmt.conf, so it does not just apply to grdconvert.