Opened 8 years ago

Closed 8 years ago

#6175 closed defect (fixed)

netCDF classic reports negative nodata value for unsigned byte > 127

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 2.1.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: netcdf
Cc:

Description

When creating a netCDF dataset (with classic netCDF) with GDAL Byte type (ie unsigned) and setting a nodata value in [128,255] range, and reading it back, it appears negative. This is due to classic netCDF only supporting signed byte by default. GDAL uses a trick (metadata _Unsigned=True) to correct the interpretation, so in case of unsigned byte, we have to offset negative nodata values by 256 to get back the correct value

Change History (2)

comment:1 by Even Rouault, 8 years ago

trunk r31158 "netCDF: read correctly nodata values in [128,255] range for (unsigned) Byte data type (#6175)"

comment:2 by Even Rouault, 8 years ago

Component: defaultGDAL_Raster
Milestone: 2.1.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.