[GIS] Clipping raster by mask layer polygon produces Nodata values in QGIS

clipdemgdalqgisraster

I have a raster .tif Digital Elevation Model I am trying to clip to an irregular polygon using the GDAL\Clip raster by mask layer. I ticked 'Crop the extent of target dataset to extent of cutline'.

However, the output raster has the grid cells outside the mask layer cutline converted to 'Nodata' (apart from being annoying, it also retains the large file size of the source raster). I tried setting the destination nodata value to 'None', but this resulted in values of zero instead. (Please note that I do not know how to use the Commander/Python.) Any advice please?

processing.runalg("gdalogr:cliprasterbymasklayer","Input Raster", "Clip layer.shp",
                  "",False,True,False,5,4,75,6,1,False,0,False,"","Output raster")

Best Answer

This is normal behaviour, since raster data are matrices defined by extent (rectangle by default) and cell size- resolution (each cell have same size) or number of columns and rows in extent.

Related Question