2

I am using GDAL raster calculator in QGIS. I was getting some funny results where my input raster had "no data" so I ran some tests.

(5<no data) gives 1

(5>no data) gives 0

10 - no data = no data

1/nodata = 2.9e-39

From this I deduce that "no data" values are treated as infinite. Is this correct? I can't find anywhere in the documentation which describes the treatment of "no data" values. This interpretation does not explain why addition or subtraction gives "no data" as the result.

8
  • I think it treats is a NaN
    – Ian Turton
    Commented Sep 16, 2021 at 13:39
  • OK, so is NaN treated as infinite? Commented Sep 16, 2021 at 14:31
  • because you aren't supposed to do maths with NaN
    – Ian Turton
    Commented Sep 16, 2021 at 14:46
  • 1
    @IanTurton - that seems completely correct - however, what then 1/nodata or 5<no data does not result in no data as well, but returns a number?
    – Babel
    Commented Sep 16, 2021 at 14:48
  • 1
    There may be some useful information in github.com/OSGeo/gdal/issues/1893.
    – user30184
    Commented Sep 16, 2021 at 15:40

0

Your Answer

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

Browse other questions tagged or ask your own question.