#7245 closed defect (fixed)
gdalwarp w/netCDF output forces nodata value of 0
Reported by: | bnordgren | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.3.0 |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
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. .
Change History (4)
comment:1 by , 6 years ago
comment:3 by , 6 years ago
Milestone: | → 2.3.0 |
---|
I didn't quite reproduce your exact errors, but I did see issues fixed by above commits.
Note:
See TracTickets
for help on using tickets.
In 41576: