2

In QGIS raster calculator, how is the syntax to refer to nodata values? Lets say I have a raster and want to generate a binary output raster with data -> 1 and nodata -> 0. There is an easy way to achieve this using the tool Fill NoData cells (see docu), but I'm wondering how to do it directly in raster calulator.

I tried different syntaxes like:

  • "Raster@1" >=0
  • "Raster@1" / "Raster@1"
  • "Raster@1" = -9999 (where -9999 is assigned to nodata values)

Output is always 1 / -3.40...e+38 (the last one the default for nodata values). nodata always remains nodata, no matter what I try.

How is it possible to convert nodata values to a specific value? So basically I look for what is described here for ArcGIS.

2
  • What value is used as nodata in your source raster?
    – user30184
    Commented Jan 5, 2022 at 7:18
  • @user30184 - nodata is -9999 - but using this value does not help, see updated question.
    – Babel
    Commented Jan 5, 2022 at 8:40

0

Your Answer

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