[gdal-dev] offset and scale

Frank Warmerdam warmerdam at pobox.com
Mon May 5 15:51:09 EDT 2008


Trent M Hare wrote:
> 
> I have a set of existing 16bit geoTiffs.  While converting there was no 
>  "Offset" or "Scale" in the converted image. I now need to add a Offset 
> and Scale values postmortem such that at least the label is correct.  Is 
> there a clever way to do this on the existing images or even maybe via a 
> created VRT format and a convert again?

Trent,

You can add scale and offset in a .VRT file using the <Offset> and
<Scale> tags per the VRT tutorial.

eg.

gdal_translate abc.tif -of VRT abc.vrt
... edit abc.vrt ...
... insert something like the following as children of <VRTRasterBand> ...
     <Scale>0.25</Scale>
     <Offset>100</Offset>

gdal_translate abc.vrt abc2.tif


Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list