netcdf driver cannot read netcdf-4 files with UBYTE data
|Reported by:||etourigny||Owned by:||etourigny|
Files that are of unsigned byte data type in the NC4 (netcdf-4) format are incorrectly read. To reproduce do the following
$ gdal_translate -of netcdf -co FORMAT=NC4 byte.tif byte.nc $ gdalinfo -checksum byte.nc [...] ERROR 1: netCDF scanline fetch failed: #-60 (NetCDF: Numeric conversion not representable) ERROR 1: byte.nc, band 1: IReadBlock failed at X offset 0, Y offset 0 ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0 ERROR 3: Checksum value couldn't be computed due to I/O read error. Checksum=0
The problem does not appear when files are saved in netcdf-4 classic format, because it uses NC_BYTE and not NC_UBYTE.
Also, metadata (such as missval) is not supported if a variable is not stored in NC_UBYTE type.
GDAL_netCDF: NCDFGetAttr unsupported type 7 for attribute _FillValue