But I can't figure out how to customize the <band name>, which is Band1, Band2, Band3...
I tried GDALRasterBand::SetDescription(), but without success

Looking at netcdfdataset.cpp line 9625, the netCDF variable name for a band is extracted from the NETCDF_VARNAME band metadata item of the source band.


Sounds good, doesn't work.
Actually, band->SetMetadataItem("NETCDF_VARNAME","somename...") does not raise any error and I tracked with a debugger that it goes down to  GDALMultiDomainMetadata::SetMetadataItem() and really calls CPLStringList::AddNameValue(),

but when reading the saved dataset file created by the netCDF driver, SUBDATASET_<i>_NAME are still "netcdf:<file>:Band1, Band2..."

I am still investigating to see if it might be related to the wrong domain, but so far I can't tell.

Pierre
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to