Changes between Version 3 and Version 4 of rfc58_removing_dataset_nodata_value
- Timestamp:
- May 15, 2015, 12:32:31 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
rfc58_removing_dataset_nodata_value
v3 v4 7 7 Status: Draft 8 8 9 Target version: 2.1 10 9 11 == Summary == 10 12 11 This RFC concerns addition of a {{{ GDALDeleteNoDataValue()}}} function to the GDAL C API. This function removes a dataset's nodata value. When it succeeds, the datasetwill have no nodata value. When it fails, the nodata value will be unchanged.13 This RFC concerns addition of a {{{DeleteNoDataValue()}}} function to the C++ GDALRasterBand API. This function removes the nodata value of a raster band. When it succeeds, the raster band will have no nodata value. When it fails, the nodata value will be unchanged. 12 14 13 15 == Rationale == 14 16 15 In the C API the nodata value has accessors {{{GDALGetNoDataValue()}}} and {{{GDALSetNoDataValue()}}}. For GeoTIFFs, the value is stored in a TIFFTAG_GDAL_NODATA TIFF tag. Newly created GeoTIFF files can have no nodata value (no tag), but once a nodata value is set and stored it can only be given new values, it can not be removed. Nor can it be set to a value outside the range of the data type; for 8-bit data passing {{{nan}}}, {{{-inf}}}, or {{{256}}} to {{{GDALSetNoDataValue()}}} has the same effect as passing 0.17 The nodata value has accessors {{{GetNoDataValue()}}} and {{{SetNoDataValue()}}}. For GeoTIFFs, the value is stored in a TIFFTAG_GDAL_NODATA TIFF tag. Newly created GeoTIFF files can have no nodata value (no tag), but once a nodata value is set and stored it can only be given new values, it can not be removed. Nor can it be set to a value outside the range of the data type; for 8-bit data passing {{{nan}}}, {{{-inf}}}, or {{{256}}} to {{{GDALSetNoDataValue()}}} has the same effect as passing 0. 16 18 17 19 The problem with un-removable nodata values is this: … … 24 26 == Changes == 25 27 26 {{{GDALDeleteNoDataValue()}}} will be added to gdal.h. 28 The {{{virtual CPLErr DeleteNoDataValue()}}} method will be added to the GDALRasterBand method in gdal_priv.h (C++ API), and {{{CPLErr GDALDeleteRasterNoDataValue()}}} to gdal.h (C API) 27 29 28 30 === Updated drivers === 29 31 30 The following drivers will be updated: GTiff, MEM, VRT .32 The following drivers will be updated: GTiff, MEM, VRT and KEA. 31 33 32 The {{{GDALPamRasterBand}}} class will also be updated (for drivers that have no built-in mechanism nodata mechanism and rely on .aux.xml sidecars). 34 For GTiff, the TIFFTAG_GDAL_NODATA TIFF tag is unset if GDAL is built against libtiff 4.X, which is the appropriate behaviour. For libtiff 3.X where TIFFUnsetField() does not exist, the tag is set to the empty string : GDAL 2.0 will detect that as the absence of a nodata value, older versions will parse it as 0. 35 36 The {{{GDALPamRasterBand}}} class will also be updated (for drivers that have no built-in mechanism nodata mechanism and rely on .aux.xml sidecars). Note that this only removes the <NoDataValue> tag from the .aux.xml, so in the situation where a driver would have a internal way of storing nodata, but would be opened in read-only mode (so defaulting to PAM), DeleteNoData() would have no effect. 33 37 34 38 == SWIG bindings (Python / Java / C# / Perl) changes == 35 39 36 No changes to the SWIG bindings are proposed. 40 The DeleteNoDataValue() method is added to the RasterBand object. 37 41 38 42 == Utilities == 39 43 40 No changes to utilities are proposed.44 The gdal_edit.py script is enhanced with a -unsetnodata option. 41 45 42 46 == Documentation == 43 47 44 No new documentation is proposed.48 The new method and function are documented. 45 49 46 50 == Test Suite == 47 51 48 T BD.52 The tests of the updated drivers test the effect of the new method. 49 53 50 54 == Compatibility Issues == 51 55 52 None .56 None for the C API. ABI change for the C++ API because of introduction of a new virtual method. 53 57 54 58 == Related ticket == … … 56 60 #2020 mentions the issue. 57 61 58 59 62 == Implementation == 60 63 61 64 Implementation will be done by Even Rouault and be sponsored by Mapbox. 62 65 66 A proposed implementation is available in https://github.com/OSGeo/gdal/compare/trunk...rouault:rfc58_removing_nodata_value 67 63 68 == Voting history 69 70 TBD