[gdal-dev] Removing default nodata value from netCDF driver ?

Even Rouault even.rouault at spatialys.com
Tue Nov 5 02:18:57 PST 2019


On mardi 5 novembre 2019 01:18:35 CET Julien Demaria wrote:
> Hi Even,
> 
> Are you sure that the driver uses a default fill value if the attribute is
> not present?

Yes, the raster band constructor systematically called SetNoDataValue() even 
if the bGotNoData flag was not set before.

Thanks a lot for your very valuable feedback on this! I've issued in
https://github.com/OSGeo/gdal/pull/1983 a less radical change which follows 
your suggestions (and solves the issue that triggered this discussion), that 
is:
- for char/byte/ubyte data types, do not set a NoData value if there's no 
explicit _FillValue or missing_value attribute
- for other data types, use nc_inq_var_fill() to get the default value, and 
fallback to the hard-coded NC_FILL_xxx constants

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list