id summary reporter owner description type status priority milestone component version severity resolution keywords cc 7245 gdalwarp w/netCDF output forces nodata value of 0 bnordgren warmerdam "Using gdalwarp to resample an input image and store the result in a netCDF file results in the nodata value being set to zero for formats NC4 and NC4C. Formats NC and NC2 seem to work as expected. In my case, the target nodata value is 255 and the data type is byte. Bad: {{{ gdalwarp -of netCDF -co FORMAT=NC4 ... gdalwarp -of netCDF -co FORMAT=NC4C ... }}} However, saving the results of the gdalwarp to geotiff format, then performing a separate gdal_translate to netCDF preserves the nodata value. Good: {{{ gdalwarp -of GTiff ... gdal_translate -of netCDF -co FORMAT=NC4 ... }}} Attempting to set the nodata value with `-dstnodata 255` results in: {{{ ERROR 1: netcdf error #-122 : NetCDF: Attempt to define fill value when data already exists. . }}} " defect closed normal 2.3.0 default unspecified normal fixed