[gdal-dev] Loading a scaled rawfile via VRT

Solomon Gibbs solomon.gibbs at gmail.com
Thu Feb 16 14:13:49 EST 2012

Sure. Here is what I am trying to do.

The raw data has some junk on the front end of the file that needs to
be skipped:
<VRTDataset rasterXSize="1476" rasterYSize="1784">
 <VRTRasterBand band="1" dataType="UInt16" subClass="VRTRawRasterBand">
   <SourceFilename relativetoVRT="1">xxxxxxx</SourceFilename>

Then, apply the scaling factor:
<VRTDataset rasterXSize="1476" rasterYSize="1784">
<VRTRasterBand dataType="Float32">
   <SourceFilename relativeToVRT="1">xxxxxxx.vrt</SourceFilename>

So, I'm not clear if the SourceProperties tag can be used to define
the offset as well as the raster definition as you suggest. I was
hoping to maybe be able to nest the RawRasterBand under the
ComplexSource in place of the SourceFilename, but that hasn't worked
for me so far.

On Thu, Feb 16, 2012 at 1:42 PM,  <anton.korosov at nersc.no> wrote:
> Hi Solomon,
> I believe you can just specify the following tag within the ComplexSource:
> <SourceProperties RasterXSize="512" RasterYSize="512" DataType="Byte"
> BlockXSize="128" BlockYSize="128"/> (of course setting the correct values)
> In this tag you can explicitly indicate the type of the source.
> For a more definite answer can you please give an example of the two VRT
> files that you create.
> Anton
>> I have raw data stored as UInt16 that needs to be scaled by a
>> (floating point) calibration factor and presented as Float32. I can
>> successfully load the UInt data using VRTRawRasterBand and scale it
>> using VRT ComplexSource. However, this seems to mean creating two
>> separate VRT datasets and files.
>> Is there any way to combine loading raw data and scaling to a floating
>> point value into a single dataset definition?
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev

More information about the gdal-dev mailing list