Changes between Version 3 and Version 4 of RasterVrtDerivedBands

Show
Ignore:
Timestamp:
02/16/12 11:37:24 (15 months ago)
Author:
armin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RasterVrtDerivedBands

    v3 v4  
    11= Using GDAL VRT images with derived bands in MapServer = 
    22 
    3 The GDAL virtual image format (VRT) allows the creation of derived bands that derive their pixel information from their source bands. A general overview is given at the [http://www.gdal.org/gdal_vrttut.html GDAL web site]. This how-to describes the steps to make this type of raster format usable in !MapServer, based on the sample code of the GDAL site. The emphasis lies on the creation and registration of the required pixel function used for the derived band. 
     3The GDAL virtual image format (VRT) allows the creation of bands that derive their pixel information from their source bands (using raster algebra). A general overview is given at the [http://www.gdal.org/gdal_vrttut.html GDAL web site]. This how-to describes the steps to make this type of raster format work from the !MapServer environment. The code samples are based on the code from the GDAL site. The emphasis lies on the creation and registration of the required pixel function used for the derived band(s). 
    44 
    55== Definition of the VRT image == 
     
    88<VRTDataset rasterXSize="1000" rasterYSize="1000"> 
    99    <VRTRasterBand dataType="Float32" band="1" subClass="VRTDerivedRasterBand"> 
    10         <Description>Magnitude</Description> 
    11         <PixelFunctionType>TestFunction</PixelFunctionType> 
    12         <SourceTransferType>CFloat64</SourceTransferType> 
     10         
     11    <PixelFunctionType>TestFunction</PixelFunctionType> 
    1312    ... 
    1413}}} 
    1514 
    16 The important part is the refernce of the pixel function, here name {{{TestFunction}}} 
     15The important part is the reference of the pixel function, here named {{{TestFunction}}}. 
    1716 
    1817== Creation of the pixel function == 
     
    5857} 
    5958 
     59/* Register the function */ 
    6060void GDALRegister_TestFunction() { 
    6161     GDALAddDerivedBandPixelFunc("TestFunction", TestFunction); 
    6262} 
     63 
    6364}}} 
     65 
    6466 
    6567Compile the function 
     
    8284}}} 
    8385 
    84 Restart the Apache server and the VRT images with the pixel functions should be read without problems from !MapServer. At least for simple raster algebra I have not noticed performance degradation due to the derived bands.  
     86More information for {{{GDAL_DRIVER_PATH}}} [http://trac.osgeo.org/gdal/wiki/ConfigOptions#GDAL_DRIVER_PATH see here]. 
    8587 
    86 Important to note that the pixel function works also for the image ''overviews'' (at least using the standard internal and external .ovr files, ERDAS .aux types have not been tested with this). 
     88Restart the Apache server and the VRT images with the pixel functions should be read without problems from !MapServer. At least for simple raster algebra I have not experienced noticeable performance degradation due to the derived bands.  
     89 
     90Important to note that the pixel function works also for the image ''overviews'' (at least using the standard internal overviews or external .ovr files, ERDAS .aux types have not been tested with this). 
    8791 
    8892== Use of VRT derived bands with PHP !MapScript == 
     
    9599(one of them might not be necessary...) 
    96100 
    97 Restart Apache and everything should work. 
     101Restart Apache and everything should work.  
     102 
     103For other !MapScript versions this additional setting of the GDAL environment variable might be necessary as well. 
    98104 
    99105