3

I've encountered the following problem frequently when I am using the raster calculator, even though sometimes the calculator works. However, I cannot figure out the difference between the times it works and the ones it does not.

The raster layer I am using is a gridded population. I want to create a mask layer with 1 meaning that there exists a population larger than 100 in the grid and 0 otherwise. The operation I use is ("lspop2010@1" > 100) * 1.

The output range is depicted in the picture below. Basically, the calculation produces a layer with no-data values only. Does anyone know the source of this problem?

example

Taras
  • 32,823
  • 4
  • 66
  • 137
philsch
  • 327
  • 2
  • 10
  • I am not sure about your raster calculation but it sounds like you are trying to reclassify your raster . Have a look at this post. https://gis.stackexchange.com/questions/121532/how-to-reclass-a-raster-with-reclassify-grid-values-in-qgis – GBG Aug 22 '19 at 15:20

1 Answers1

2

"Reclassify by table" in the Processing toolbox did the job.

There, you just need to define the range values and click the box "use no-data when no range matches value". Then you will get your mask layer.

Thanks to GBG for suggesting the post where I found the solution.

philsch
  • 327
  • 2
  • 10