Bug report #22051

Build Virtual Raster is not considering Nodata = -9999

Added by Sergio Antonio almost 5 years ago. Updated almost 5 years ago.

Status:Closed
Priority:Normal
Assignee:Alexander Bruy
Category:Processing/GDAL
Affected QGIS version:3.4.7 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:29865

Description

The Build Virtual Raster tool - QGIS 3.4.7 (Resolution: average, Place alpha mask: off, Ressampling algorithm: nearest, Nodata value: -9999) seems not to be considering Nodata = -9999. Please see attached picture.
The four orthophotos were clipped using the GDAL Clip Raster by Mask Layer tool (Nodata value = -9999, Creat an output alpha band: off, Match the extent of the clipped raster to the extent of the mask layer: on, Keep resolution of output raster: off, Profile: Default, Output data type: Float64).
Note that the Merge tool - QGIS 3.4.7 (Output data type = Float64; Input pixel value to treat Nodata = -9999; Assign specified Nodata value to output = - 9999) works fine and creates the output file correctly

build virtual raster -9999.png (88.9 KB) Sergio Antonio, 2019-05-12 11:44 PM

History

#1 Updated by Giovanni Manghi almost 5 years ago

  • Category changed from Processing/Core to Processing/GDAL

#2 Updated by Alexander Bruy almost 5 years ago

  • Operating System deleted (Windows 10)
  • Assignee set to Alexander Bruy
  • Status changed from Open to Feedback

Actually this is not bug. "Build virtual raster" algorithm allows to specify nodata value(s) for input bands while you are looking for a VRT nodata value. Please check GDAL documentation about difference between them https://www.gdal.org/gdalbuildvrt.html

#3 Updated by Sergio Antonio almost 5 years ago

Alexander Bruy wrote:

Actually this is not bug. "Build virtual raster" algorithm allows to specify nodata value(s) for input bands while you are looking for a VRT nodata value. Please check GDAL documentation about difference between them https://www.gdal.org/gdalbuildvrt.html

Thank you. I understood and I agree that this is not a bug of the virtual raster build tool. However the white pixels of the attached result show the perimeters of the original images (before being cut using the Match the extent of the clipped raster to the extent of the mask layer option: on). I tried several configurations of the GDAL Clip Raster by Mask Layer and Build Virtual Raster tools. Excuse me, would you have any recommendations before closing this matter?

#4 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Feedback to Closed
  • Resolution set to invalid

you probably need to add the alpha band when you clip.

Also available in: Atom PDF