0

In my research I have a Ndvi raster layer, and I want to delete the values corresponding to bare soil, which are those minor of 0.31. Therefore, I will obtain a new raster layer with those values higher or equal to 0.31.

Could anybody help me with this?

I am using QGIS.

BERA
  • 72,339
  • 13
  • 72
  • 161
Ange
  • 63
  • 3

2 Answers2

1

Use the Reclassify by Table on your NDVI layer where all values less than or equal to 0.31 get values of -9999 and all other values get a value of 1. Ensure -9999 is the no data value in the Reclassify by Table tool. Then, use the raster calculator to multiply you newly reclassified output by the original NDVI. The resulting layer will have no data values anyplace there was a 0.31 or less value and the original NDVI value if greater. Here is a link to the reclassify by table tool.

GBG
  • 9,737
  • 1
  • 15
  • 44
  • Thank you very much. The -9999 is the non data when I am doing the Translate (convert format), right? – Ange Oct 21 '19 at 15:31
1

You cant delete values in a raster but you can set them to no data.

  1. Set values <0.31 to -5 and all other to the ndvi raster values using Raster calculator: ("ndvi@1"<0.31)*-5 + ("ndvi@1">=0.31)*"ndvi@1"

enter image description here

  1. Translate and set no data value to -5 enter image description here Result: enter image description here

(See: How to set all pixels with value <= 0 to "nodata" in DEM raster?)

BERA
  • 72,339
  • 13
  • 72
  • 161