[feature request] Adding basic support for AddBand() as 2D variables with netCDF driver
Feature description
Currently, (gdal 3.8) the netCDF driver does not support AddBand(). This driver could have such a feature since bands can be NETCDF variables.
Additional context
quoted from a discussion on the mailing list
Also, is there a reason why AddBand() is not supported by the netCDF driver ? I expected it to be able to add bands on demand as new "netcdf variables".
I guess that could be implemented. There would be a subtlety however:
-
if CreateCopy() has been invoked with NETCDF_DIM_EXTRA_xxx, NETCDF_DIM_xxx_DEF metadata items, to ask for bands to be modeled as a dimension (for example the time dimension of a 3D variable), that would require the band dimension to be created as UNLIMITED however at dataset creation.
-
otherwise for 2D variables, yes, implementing AddBand() should be relatively straighforward ... hopefully ... (please don't sue me, if it is not. The netCDF driver has its peculiarities...)