[GDAL Metadata] confused ENVI data gain with GDAL data scale

Issue #1159 resolved
Andreas Rabe created an issue

How to reproduce:

Open enmap_berlin.bsq GDAL Metadata.

The reported offset and scale values are not those of the GDAL metadata model, but those from the ENVI header:

Note that GDAL (and even the ENVI software itself) are ignoring the offset/gain information from the ENVI header.

Note that GDAL band scale for enmap_berlin.bsq is 1:

Actual data is scaled between 0 and 10000:

Comments (8)

  1. Andreas Rabe reporter

    Also note that a data gain of 10000 in ENVI is equal to a a data scale of 1e-4 in GDAL.

  2. Andreas Rabe reporter

    You present ENVI Data Offset and Scale as if it is relevant for the user. But it’s not really relevant, because QGIS and all algorithms will ignore those.

    GDAL Offset and Scale would be relevant for the user, because QGIS and the algorithms will use. Those values aren’t presented.

    This will confuse users.

  3. Benjamin Jakimow

    I think it is the context of a usecase which makes a metadata information relevant or not.
    The table shows band-specific metadata, and in general metadata that is somehow stored with the image. This does not necessarely mean that the metadata is used by any API / application.
    For example, if an ENVI header file defines multiple offsets (data offset values and data reflectance gain values), it should be shown here, no matter GDAL or QGIS use it to scale the pixel values.

  4. Andreas Rabe reporter

    Fair enough, but why aren’t you showing the (relevant) GDAL Offset and Scale values?

  5. Log in to comment