[QGIS-Developer] Mesh netcdf NaN visualisation in QGIS?

Richard Duivenvoorde rdmailings at duif.net
Mon Sep 4 00:57:38 PDT 2023


Hi,

My colleague is creating netcdf as output of some other modelling 
software, and viewing/styling it in QGIS.

In some places the modelling software goes awry and produces NaN's in de 
netcdf.

Anybody an idea to create a visualisation (in QGIS) to find out WHICH 
part/cell's contain a NaN?

output of ncdump:
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0,·
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NaNf, NaNf, NaNf, 0, 
0,·
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0,·
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0,·
     0, 0, 0, 0, 0, 0,

Found: 
https://github.com/lutraconsulting/MDAL/blob/master/mdal/frmts/mdal_netcdf.cpp#L100-L102

So apparently in MDAL this becomes 
"std::numeric_limits<double>::quiet_NaN"

But how to find these in QGIS?

Looking in Layer Styling I could use non-numbes (like None, NaN or 
whatever) in the inputs.
Same in Mesh calculator.

Any idea appreciated!

Regards,

Richard Duivenvoorde



More information about the QGIS-Developer mailing list