[gdal-dev] Support for the LUT transformation of the vrt bands
warmerdam at pobox.com
Tue Mar 11 14:33:22 EDT 2008
Tamas Szekeres wrote:
> 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
> For example:
> <VRTRasterBand dataType="Byte" band="1" subClass="VRTLUTRasterBand">
> <LUT interpolation="linear"
> <SourceFilename relativeToVRT="1">source.tif</SourceFilename>
> 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?
I would like to suggest that you handle this as additional parameters
on the VRTComplexSource rather than as a distinct band object type.
The VRTComplexSource can already apply rescaling on the fly, and it
seems like a reasonable extension to add interval based LUTs. In
some cases it may also be helpful to be able to apply different LUTs
to different sources in a virtual mosaic.
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