Bug report #3348
GDAL TIFF dataset masking not fully supported
|Affected QGIS version:||2.2.0||Regression?:||No|
|Operating System:||All||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||13408|
recent improvements in masking of TIFF by GDAL can generate images that QGis does not completely support. Improved support would understand the masks and render only non-masked pixels. note that mapserver trunk understands this masking right now..
#2 Updated by Benjamin Schepers about 6 years ago
- Affected QGIS version set to 2.2.0
- Crashes QGIS or corrupts data set to No
- Target version changed from Version 1.7.0 to Version 2.2
- Status changed from Closed to Reopened
Internal NoData-Masks in GeoTIFFs seem not to be respected by QGIS. The masked area is shown black (Value "0,0,0") and not transparent ("NoData") as it should.
Internal NoData-Masks are possible since GDAL 1.6.0 --> http://www.gdal.org/frmt_gtiff.html
Use-Case are large aerial images (BigTIFFs with JPEG-Compression and internal tiles, internal pyramids an nodata-masks for all layers) with non-rectangle borders/masks (because of administrative borders, which - of course - don't respect classic rectangle BBOXes). Many of those large images (50+) should be shown patched together; this works flawlessly and with a not too big performance-hit in mapserver (and also ArcGIS :-( ).
WORKAROUND: the internal nodata-mask could be mapped to the alpha-channel with the use of gdal_translate and a VRT.
gdal_translate -b 1 -b 2 -b 3 -b mask -of VRT $SOURCE.tif $TARGET.vrt
After adding the VRT to QGIS, there is the possibility to select the new "channel 4" as transparency-channel.
IMHO a BUGFIX or "general" nodata-mask-support would be more performant and satisfying...
EDIT: Refering to #6360 there could be another checkbox "nodata-value from internal mask"?