2

a NetCDF file with only one band with a data range from [0,1.1]. IDV & QGIS identifies it correctly, however gdalinfo finds the data range [1,26505]. Or could it be possible that gdalinfo is right and IDV & QGIS is wrong? The result is that I cannot apply the style definition from QGIS to the Mapfile. Maybe this belongs to the different value than raster statistics question?

This is the gdalinfo output:

Band 1 Block=4321x1 Type=Int16, ColorInterp=Undefined
Min=1.000 Max=26505.000 
  Minimum=1.000, Maximum=26505.000, Mean=21777.898, StdDev=7918.130
  NoData Value=-32767
  Offset: -3.81481368094683e-05,   Scale:3.81481368094683e-05
  Metadata:
    _CoordinateAxes=time_counter latitude longitude 
    _FillValue=-32767
    add_offset=-3.814813680946827e-05
    cell_methods=area: mean where frac
    long_name=Fraction
    NETCDF_DIM_time_counter=561132
    NETCDF_VARNAME=frac
    scale_factor=3.814813680946827e-05
    standard_name=area_fraction
    STATISTICS_MAXIMUM=26505
    STATISTICS_MEAN=21777.897721542
    STATISTICS_MINIMUM=1
    STATISTICS_STDDEV=7918.1303044189
    unit_long=Fraction
    units=1

UPDATE: the wgrib_get_data tool also says that the data range is between 0 and 1. So it seems that there GDAL is working wrong here.

  -64.917  -47.250 1.6586303711e-01
  -64.917  -47.167 1.2612915039e-01
  -64.917  -47.083 8.5937500000e-02
  -64.917  -47.000 3.7475585938e-02
  -64.917  -46.917 7.9650878906e-03
  -64.917  -46.833 3.7536621094e-03
  -64.917  -46.750 2.7160644531e-03
  -64.917  -46.667 1.5563964844e-03
  -64.917  -46.583 1.1596679688e-03
  -64.917  -46.500 4.2724609375e-04
  -64.917  -46.417 0.0000000000e+00
  -64.917  -46.333 0.0000000000e+00
  -64.917   52.167 0.0000000000e+00
  • 1
    QGIS and IDV are applying the offset and scale values, gdalinfo gives raw pixel values. – user10353 Nov 6 '14 at 17:46
  • Thanks for your answer. Is there a documentation for this behavior around? – dnltsk Nov 6 '14 at 20:38
  • Probably not. GDAL typically operates on images and pixel values. Scale and offsets are typically associated with displaying pixel data. A quick search turned up a github pull request with no doc changes that I can see, although I don't know how QGIS does such things: github.com/qgis/QGIS/pull/1066 – user10353 Nov 6 '14 at 20:47
  • GDAL NetCDF driver is documented in gdal.org/frmt_netcdf.html. About metadata: All netCDF attributes are transparently translated as GDAL metadata. GDAL shows the raw metadata and is thus exact but the meaning of each metadata items you must learn from unidata.ucar.edu/software/netcdf/docs. I can't say directly where it is documented how much QGIS is interpreting the NetCDF metadata for showing it for users is easier format. – user30184 Nov 6 '14 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.