[gdal-dev] Support for the LUT transformation of the vrt bands

Tamas Szekeres szekerest at gmail.com
Tue Mar 11 12:32:19 EDT 2008


Folks,

In my recent work I need a limited support for a LUT based
transformation of the bands to apply some colorization  and threshold
operations created with the gdal_grid application. I wonder if we
could implement this enhancement in the gdal vrt driver, and the
dataset could be created from the scripting interfaces (like C#)
either. By adding this functionality the vrt driver the config could
be stored in a separate configuration profile (XML) that could be
preserved and used for subsequent transformations.

In my proposal this functionality would be implemented in a new
VRTRasterBand subclass, like subClass="VRTLUTRasterBand", and we

could specify the lookup table in the following pseudo fromat:

<LUT>[source value1]:[dest value1],[source value2]:[dest value2] ...</LUT>

We could also specify the interpolation mode when gathering the
intermediary values (linear or none at the moment)

There would be another transformation parameter assigned to a LUT
denoting how the scalar value is computed in case when we have a
complex source band (the possible values are
magnitude/phase/real/imaginary)

For example:
<VRTRasterBand dataType="Byte" band="1" subClass="VRTLUTRasterBand">
  <LUT interpolation="linear"
scalarvalue="magnitude">23400.34:0,75234.45:255</LUT>
  <SimpleSource>
      <SourceFilename relativeToVRT="1">source.tif</SourceFilename>
      <SourceBand>4</SourceBand>
  </SimpleSource>
</VRTRasterBand>


I wouldn't address creating complex bands with this method at the
moment. However we could probably extend this by adding multiple LUT
nodes and data sources to a single VRTLUTRasterBand.

In the future we could possibly add helper functions to create
predefinied LUT XML nodes based on some common use cases (like
equidinstant or histogram based partitions of the source values) but
currently it's up to the user and script developer how to create the
desired vrt xml. However a graphical application could easily
visualize the LUT by applying the vrt on a sample image with linear
range of the values.

I'd like to know whether the idea above would be reasonable to
implement. Should I create an RFC on this?


Best regards,

Tamas


More information about the gdal-dev mailing list