Uploaded image for project: 'GeoTools'
  1. GEOT-5516

NetCDF add_offset and scale_factor attributes not respected

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 17-beta
    • Component/s: netcdf
    • Labels:
      None

      Description

      A NetCDF file with scale_factor and add_offset variable attributes does not have these attributes correctly applied when reading. For example, this call fails:

              float[] result = coverage
                  .evaluate((DirectPosition) new DirectPosition2D(DefaultGeographicCRS.WGS84, 5.0, 45.0),
                      new float[1]);
      
              assertEquals(1.615991, result[0], 1e-6f);
      

      java.lang.AssertionError:
      Expected :1.615991
      Actual :6.159914016723633

      Fails on the attached NETCDF file (the NO2 layer) where the scale_factor is 0.1 and the add_offset is 1

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                dtucker Devon Tucker
                Reporter:
                dtucker Devon Tucker
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: