| 64 | |
| 65 | Compile the function |
| 66 | {{{ |
| 67 | gcc -fPIC -c TestFunction.c |
| 68 | gcc -shared TestFunction.o -o TestFunction.so |
| 69 | }}} |
| 70 | |
| 71 | Create a directory for the GDAL plugins (if not already existing), and copy the compiled shared library for the pixel function there: |
| 72 | {{{ |
| 73 | mkdir /usr/local/share/gdal/gdalplugins |
| 74 | cp TestFunction.so /usr/local/share/gdal/gdalplugins/gdal_TestFunction.so |
| 75 | }}} |
| 76 | |
| 77 | |
| 78 | == Reference the GDAL plugin directory for use in MapServer (with Apache) == |
| 79 | Add a line to your Apache config file {{{httpd.conf}}} or {{{apache2.conf}}} like |
| 80 | {{{ |
| 81 | SetEnv GDAL_DRIVER_PATH /usr/local/share/gdal/gdalplugins |
| 82 | }}} |
| 83 | |
| 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. |
| 85 | |
| 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). |
| 87 | |
| 88 | == Use of VRT derived bands with PHP MapScript == |
| 89 | The above mentioned |
| 90 | |
| 91 | |