www.cogeo.org icon indicating copy to clipboard operation
www.cogeo.org copied to clipboard

add note about setting internal Nodata in COG

Open vincentsarago opened this issue 4 years ago • 1 comments

First let me say that Nodata/Mask is a complex topic. Internal nodata, bit mask in GeoTIFF are a GDAL specification (meaning introduced by GDAL devs) but are widely supported (e.g https://github.com/geotiffjs/geotiff.js/blob/ac1fe594455430ae9180f5108c0a2f32615d382f/src/globals.js#L107) and not present in the GeoTIFF nor TIFF specification (surprisingly cc @wildintellect).

When sharing data as COG if think it should be mandatory to have the nodata value/mask/alpha band set (at least when there is a ghost part in the data).

It would be really difficult to enforce this in the specification but I think the least we could do is to add a note on this web page telling that if possible a method describing the ghost/masked/undefined area must be used.

from https://github.com/mapbox/nodata

doc

  • https://github.com/OSGeo/gdal/blob/master/gdal/frmts/gtiff/libtiff/tiff.h#L479
  • https://www.awaresystems.be/imaging/tiff/tifftags/gdal_nodata.html
  • https://gdal.org/development/rfc/rfc15_nodatabitmask.html
  • https://gdal.org/drivers/raster/gtiff.html#nodata-value
  • https://gdal.org/drivers/raster/gtiff.html#internal-nodata-masks

@cholmes any though?

vincentsarago avatar Apr 03 '20 21:04 vincentsarago

I'm definitely +1 on recommendations in the web page. And if we were further on the 'spec' I'd be into making a 'best practices' document where we also strongly recommend it. But on the web page is a good start. I'd even be ok to put it in the spec, even if it's just a recommendation.

cholmes avatar Apr 03 '20 22:04 cholmes