I'm using the raster calculator from core in QGIS and I need to generate a new tif raster file (mask) from the nodata values of another tif raster file. I tried isnull(), but no luck. Any one can help? Thanks
"... I need to generate a new tif raster file (mask) from the nodata values of another tif raster file."
You can use gdalwarp, via the command line, to convert a nodata value to an alpha mask:
gdalwarp -dstalpha -srcnodata "0 0 0" -co "ALPHA=YES" "raster_w-nodata.tif" "raster_w-alpha.tif"
I do not see a simple way to do this in QGIS, yet. Most of the GDAL (Raster menu) tools work with the utilities and extra Python script bundled with GDAL. Since the underlying utilities of GDAL have a myriad of choices to suit many different scenarios, you may run into limitations of what is generally available via the GUI tools in QGIS.
dakcarto's answer worked for me, with the following modification:
gdalwarp -dstalpha -srcnodata "-9999" -co "ALPHA=YES" "rast.tif" "rast_w-alpha.tif"
Assuming your raster only has one band, like mine did. The second band in your new GeoTIFF is now the mask for data (value 0) and nodata (value 255).
I hope someone can put this into a simple plugin for QGIS 2.0, because it took me two hours to find this, and I expected to be able to just use the nodata value in the QGIS raster calculator...