I have downloaded the following precipitation data in .nc4 format(attached). I have opened the 'PRECIPITATION' variable in the file in QGIS and I have made a note of its statistics. As working with nc files consumes more data and time, I have written the data of precipitation variable in an ascii file using MATLAB. I have opened the ascii file in QGIS and I have found that the statistics i get from the properties->metadata is different from that of nc file and if i run the zonal statistics of the ascii file for the entire polygon boundary, the statistics are matching with the ones of nc file. Can anybody please help me with the reason behind this.
The asc file does not contain any statistic metadata. So QGIS uses
gadlinfo -approx_stats to get a quick result for the statistics. Further down the metadata, you will read
No stats collected yet.
You can force the computation of statistics with
gdalinfo -stats. The result will be written to a file named
30_12_2009.asc.aux.xml. You can open it with any text editor.
Once the statistics are written into the file, QGIS will read that information.
You can access gdalinfo inside QGIS with
Raster -> Miscellaneous -> Information, but would have to add
-stats manually in the command line box.