Bug report #3348

GDAL TIFF dataset masking not fully supported

Added by darkblueb - over 13 years ago. Updated over 6 years ago.

Status:Closed
Priority:Low
Assignee:-
Category:Rasters
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

Description

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..


Related issues

Duplicates QGIS Application - Bug report #2491: Raster transparency doesn't handle alpha channel Closed

History

#1 Updated by Alexander Bruy over 12 years ago

  • Pull Request or Patch supplied set to No
  • Status changed from Open to Closed
  • Assignee deleted (nobody -)
  • Resolution set to duplicate

Duplicate #2491

#2 Updated by Benjamin Schepers about 10 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"?

#3 Updated by Jürgen Fischer over 9 years ago

  • Target version changed from Version 2.2 to Future Release - Lower Priority

#4 Updated by Giovanni Manghi almost 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#5 Updated by Even Rouault over 6 years ago

  • Status changed from Reopened to Closed
  • Resolution changed from duplicate to fixed/implemented

Was implemented per 0f16eb869cf5efbce531fcb617aab36d09755306 in QGIS 3

Also available in: Atom PDF