[gdal-dev] Re: 254 into 255

Hermann Peifer peifer at gmx.eu
Fri Oct 28 13:58:25 EDT 2011


On 27/10/2011 10:58, Chaitanya kumar CH wrote:
>
> A vrt file can implement your requirements. It can create a 'lookup
> table' to translate your pixel values...

Chaitanya,

I just tried to translate an Int32 GeoTIFF with pixel values 111..523 
into a byte-type GeoTIFF with values 1..44, using the LUT as indicated 
below.

I noted that in the resulting GeoTIFF, the previous NODATA areas have 
now a pixel value of 1. Is this expected behaviour or rather some sort 
of "over-extrapolation" of my lookup table (as I would assume)  ?

Thanks in advance, Hermann



<VRTDataset rasterXSize="8786" rasterYSize="6443">
...
     <VRTRasterBand dataType="Int32" band="1">
     <NoDataValue>0.00000000000000E+00</NoDataValue>
     <ColorInterp>Gray</ColorInterp>
     <ComplexSource>
       <SourceFilename relativeToVRT="1">ch00_form.tif</SourceFilename>
       <SourceBand>1</SourceBand>
       <SourceProperties RasterXSize="8786" RasterYSize="6443" 
DataType="Int32" BlockXSize="256" BlockYSize="256" />
       <SrcRect xOff="0" yOff="0" xSize="8786" ySize="6443" />
       <DstRect xOff="0" yOff="0" xSize="8786" ySize="6443" />
       <LUT>111:1,112:2,121:3,122:4,123:5,124:6,131:7,132:8,...</LUT>
     </ComplexSource>
   </VRTRasterBand>
</VRTDataset>


More information about the gdal-dev mailing list