I have changed the No Data of a raster Forest.asc into No data = 0 using Raster -> Conversion -> Translate option in QGIS. So, when I add the output raster layer Forest_1.asc in QGIS and check for the minimum pixel value, it is showing that Minimum = 1 and Maximum = 3. But, when I open this Forest_1.asc in TextPad and read the values, I can see that it is written that No Data Value = 0. But, I am not able to find any zero as pixel value in the ascii file. I can find only 1 and 3 as pixel value in ascii file.

How can I solve this issue ?

  • Are there no-data pixels in on the map? Why would there be? Commented Feb 19, 2018 at 11:24
  • 1
    @HeikkiVesanto The exact issue is that when I open the ascii file in a TextPad, I have to see the No Data values as zero. Previously, when the No data value was 3 for this raster data, I was able to see the value 5 in the matrix inside ascii file (ascii file was having values 3 and 1; where 3 represents feature is absent and 1 represents that feature is present).
    – Sreeraj
    Commented Feb 19, 2018 at 12:00
  • 1
    @HeikkiVesanto But now, I changed the No Data value to 0 using Raster -> Conversion -> Translate option in QGIS. I can see the header "NODATA_value 0" inside ascii file. But, it is showing the previous no data value 3 instead of the new no data value 0. I want to get an output which replaces 3 to 0. I hope that you have understood what is the exact issue.
    – Sreeraj
    Commented Feb 19, 2018 at 12:00
  • Welcome to gis.stackexchange! Please edit the title of your question to include enough information for future visitors to be able to find this thread when looking for the same problem.
    – underdark
    Commented Feb 19, 2018 at 20:16

1 Answer 1


I have solved this issue by using the Reclassify values algorithm of SAGA GIS.

Processing Toolbox -> SAGA -> Raster tools -> Reclassify values 

It is possible to change a single pixel value in the matrix to a new value; and also it is possible to reclassify in a particualar range of values as well.

In this Reclassify values algorithm, I have used the option 'old value (for single value change)' = 3.0 and 'new value (for single value change)' = 0.0 . Thus I have successfully solved this issue.

It is also possible to implement this algorithm using Python programming in QGIS Python Console; as given below.


By using the above python code, I am changing all the pixel values = 3 into value 0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.