[gdal-dev] Writing Pixel Functions with VRT

Even Rouault even.rouault at mines-paris.org
Wed Dec 21 15:44:14 EST 2011


Le mercredi 21 décembre 2011 20:41:04, Yves Jacolin (free) a écrit :
> Hello,
> 
> I have some question about writing pixel functions with vrt files. I have a
> netcdf file with two subset named U and V.
> 
> How can I process sqrt(U^2 + V^2) using this feature with vrt file?
> 
> * do I need to create a C file and build GADL with it?
> * do I need to create a C file and locate it close to vrt file?

It depends on how you want to use those pixel functions. If it is in an 
application in C/C++ that you develop and that uses GDAL, then it is sufficient 
to place the pixel function in your code and register it.

If you want the pixel functions to be usable by existing GDAL utilities or 
third-party programs using GDAL (QGIS...), then a solution is to create a 
small shared library that will be loaded as a GDAL plugin. See 
http://trac.osgeo.org/gdal/ticket/3367 that has already a few functions.

You just need to make sure that the plugin is accessible through 
GDAL_DRIVER_PATH environmenet variable. No need for it to be close to the VRT 
file.

Or you can indeed hack GDAL itself and add it and register it.

> 
> Thanks,
> 
> Y.


More information about the gdal-dev mailing list