0

I'm loading several bands and images as VRT to obtain a mosaic. Each of these bands can have an offset and/or scale that I'm already taking care of. When transforming the resulting VRT into a TIFF file, the bands don't have this scale and offset applied, instead, these values are noted in the metadata for each band. Is there any way I can apply these scale and offset when building the TIFF with gdalwarp?

1 Answer 1

1

As far as I'm aware gdalwarp can't do this directly, but gdal_translate can be used with the -unscale argument:

-unscale

  Apply the scale/offset metadata for the bands to convert scaled values to unscaled values. It is also often necessary to reset the output datatype with the -ot switch. The unscaled value is computed from the scaled raw value with the following formula:

  unscaled_value = scaled_value * scale + offset

https://gdal.org/programs/gdal_translate.html#cmdoption-gdal_translate-unscale

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.