Changes between Version 3 and Version 4 of rfc58_removing_dataset_nodata_value


Ignore:
Timestamp:
May 15, 2015, 12:32:31 AM (9 years ago)
Author:
Even Rouault
Comment:

Updates

Legend:

Unmodified
Added
Removed
Modified
  • rfc58_removing_dataset_nodata_value

    v3 v4  
    77Status: Draft
    88
     9Target version: 2.1
     10
    911== Summary ==
    1012
    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 dataset will have no nodata value. When it fails, the nodata value will be unchanged.
     13This 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.
    1214
    1315== Rationale ==
    1416
    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.
     17The 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.
    1618
    1719The problem with un-removable nodata values is this:
     
    2426== Changes ==
    2527
    26 {{{GDALDeleteNoDataValue()}}} will be added to gdal.h.
     28The {{{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)
    2729
    2830=== Updated drivers ===
    2931
    30 The following drivers will be updated: GTiff, MEM, VRT.
     32The following drivers will be updated: GTiff, MEM, VRT and KEA.
    3133
    32 The {{{GDALPamRasterBand}}} class will also be updated (for drivers that have no built-in mechanism nodata mechanism and rely on .aux.xml sidecars).
     34For 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
     36The {{{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.
    3337
    3438== SWIG bindings (Python / Java / C# / Perl) changes ==
    3539
    36 No changes to the SWIG bindings are proposed.
     40The DeleteNoDataValue() method is added to the RasterBand object.
    3741
    3842== Utilities ==
    3943
    40 No changes to utilities are proposed.
     44The gdal_edit.py script is enhanced with a -unsetnodata option.
    4145
    4246== Documentation ==
    4347
    44 No new documentation is proposed.
     48The new method and function are documented.
    4549
    4650== Test Suite ==
    4751
    48 TBD.
     52The tests of the updated drivers test the effect of the new method.
    4953
    5054== Compatibility Issues ==
    5155
    52 None.
     56None for the C API. ABI change for the C++ API because of introduction of a new virtual method.
    5357
    5458== Related ticket ==
     
    5660#2020 mentions the issue.
    5761
    58 
    5962== Implementation ==
    6063
    6164Implementation will be done by Even Rouault and be sponsored by Mapbox.
    6265
     66A proposed implementation is available in https://github.com/OSGeo/gdal/compare/trunk...rouault:rfc58_removing_nodata_value
     67
    6368== Voting history
     69
     70TBD